//
// ssl_security_cert_chain from 0xfd9f74 to 0xfda030 (188 bytes)
//
// 3 xrefs:
// > ssl_add_cert_chain @ 0xfb9694
// > ssl_add_cert_chain @ 0xfb9730
// > ??> @ 0x54d78
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:15:34 +0000
//
__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;
}