//
// ssl_cert_select_current from 0x79144c to 0x7915bc (368 bytes)
//
// 3 xrefs:
// > ssl3_ctrl @ 0x78f644
// > ssl3_ctx_ctrl @ 0x790290
// > ??> @ 0x5af4c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall ssl_cert_select_current(_DWORD *a1, int a2)
{
_DWORD *v4; // r4
int v5; // r5
int v7; // r3
if ( !a2 )
return 0;
if ( a1[5] == a2 && a1[6] )
{
v7 = 0;
LABEL_17:
*a1 = &a1[5 * v7 + 5];
return 1;
}
if ( a1[10] == a2 && a1[11] )
{
v7 = 1;
goto LABEL_17;
}
if ( a1[15] == a2 && a1[16] )
{
v7 = 2;
goto LABEL_17;
}
if ( a1[20] == a2 && a1[21] )
{
v7 = 3;
goto LABEL_17;
}
if ( a1[25] == a2 && a1[26] )
{
v7 = 4;
goto LABEL_17;
}
if ( a1[30] == a2 && a1[31] )
{
v7 = 5;
goto LABEL_17;
}
if ( a1[35] == a2 && a1[36] )
{
v7 = 6;
goto LABEL_17;
}
v4 = a1;
v5 = 0;
while ( !v4[6] || !v4[5] || X509_cmp(v4[5], a2) )
{
++v5;
v4 += 5;
if ( v5 == 7 )
return 0;
}
*a1 = &a1[5 * v5 + 5];
return 1;
}