//
// ssl_cert_set0_chain from 0xfb86f8 to 0xfb87f4 (252 bytes)
//
// 5 xrefs:
// > ssl3_ctrl @ 0xfb7308
// > ssl3_ctx_ctrl @ 0xfb7904
// > ssl_cert_set1_chain @ 0xfb882c
// > ssl_cert_set1_chain @ 0xfb8898
// > ??> @ 0x49930
//
// 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:16 +0000
//
__int64 __fastcall ssl_cert_set0_chain(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v3; // x23
int v7; // w19
__int64 v8; // x0
unsigned int v9; // w0
bool v10; // cc
__int64 v11; // x1
if ( a1 )
{
v3 = **(_QWORD **)(a1 + 328);
if ( v3 )
goto LABEL_3;
return (unsigned int)v3;
}
v3 = **(_QWORD **)(a2 + 288);
if ( !v3 )
return (unsigned int)v3;
LABEL_3:
v7 = 0;
do
{
v10 = v7 < (int)OPENSSL_sk_num(a3);
v11 = (unsigned int)v7++;
if ( !v10 )
{
OPENSSL_sk_pop_free(*(_QWORD *)(v3 + 16), X509_free);
*(_QWORD *)(v3 + 16) = a3;
return 1;
}
v8 = OPENSSL_sk_value(a3, v11);
v9 = ssl_security_cert(a1, a2, v8, 0, 0);
}
while ( v9 == 1 );
ERR_put_error(20, 340, v9, "ssl/ssl_cert.c", 273);
return 0;
}