//
// ssl_security_cert_chain from 0xd5bc20 to 0xd5bcdc (188 bytes)
//
// 3 xrefs:
// > ssl_add_cert_chain @ 0xd3b340
// > ssl_add_cert_chain @ 0xd3b3dc
// > ??> @ 0x3a518
//
// 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
//
__int64 __fastcall ssl_security_cert_chain(__int64 a1, __int64 a2, __int64 a3, int a4)
{
int v7; // w19
__int64 result; // x0
__int64 v9; // x0
bool v10; // cc
__int64 v11; // x1
v7 = 0;
if ( !a3 )
{
v7 = 1;
a3 = OPENSSL_sk_value(a2, 0);
}
result = ssl_security_cert(a1, 0, a3, a4, 1);
if ( (_DWORD)result == 1 )
{
while ( 1 )
{
v10 = v7 < (int)OPENSSL_sk_num(a2);
v11 = (unsigned int)v7++;
if ( !v10 )
break;
v9 = OPENSSL_sk_value(a2, v11);
result = ssl_security_cert(a1, 0, v9, a4, 0);
if ( (_DWORD)result != 1 )
return result;
}
return 1;
}
return result;
}