//
// ssl_security_cert from 0xfd9d98 to 0xfd9f74 (476 bytes)
//
// 8 xrefs:
// > ssl_cert_set0_chain @ 0xfb8748
// > ssl_cert_add0_chain_cert @ 0xfb88c4
// > ssl_build_cert_chain @ 0xfb9abc
// > SSL_use_certificate @ 0xfc2688
// > SSL_CTX_use_certificate @ 0xfc2f7c
// > ssl_security_cert_chain @ 0xfd9fa8
// > ssl_security_cert_chain @ 0xfd9fdc
// > ??> @ 0xb2eb8
//
// 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(__int64 a1, __int64 a2, __int64 a3, int a4, int a5)
{
unsigned int v8; // w23
unsigned int v9; // w21
unsigned int v10; // w22
__int64 v11; // x0
__int64 v12; // x0
unsigned int v13; // w2
int v14; // w0
unsigned int v15; // w2
__int16 extension_flags; // w0
__int64 signature_nid; // x0
unsigned int v18; // w3
unsigned int v19; // w2
int v20; // w0
__int64 v23; // x0
unsigned int v24; // w2
int v25; // w0
int sigid_algs; // w0
__int64 v27; // x0
__int64 digestbyname; // x0
unsigned int v29; // [xsp+5Ch] [xbp+5Ch] BYREF
if ( !a4 )
{
v8 = 393234;
v9 = 393233;
v10 = 393232;
v11 = a3;
if ( a5 )
goto LABEL_3;
LABEL_17:
v23 = X509_get0_pubkey(v11);
if ( v23 )
{
v24 = EVP_PKEY_security_bits(v23);
if ( a1 )
{
LABEL_19:
v25 = ssl_security(a1, v9, v24, 0, a3);
goto LABEL_20;
}
}
else
{
v24 = -1;
if ( a1 )
goto LABEL_19;
}
v25 = ssl_ctx_security(a2, v9, v24, a1, a3);
LABEL_20:
v15 = 397;
if ( !v25 )
return v15;
goto LABEL_7;
}
v8 = 397330;
v9 = 397329;
v10 = 397328;
v11 = a3;
if ( !a5 )
goto LABEL_17;
LABEL_3:
v12 = X509_get0_pubkey(v11);
if ( v12 )
{
v13 = EVP_PKEY_security_bits(v12);
if ( a1 )
{
LABEL_5:
v14 = ssl_security(a1, v10, v13, 0, a3);
goto LABEL_6;
}
}
else
{
v13 = -1;
if ( a1 )
goto LABEL_5;
}
v14 = ssl_ctx_security(a2, v10, v13, a1, a3);
LABEL_6:
v15 = 399;
if ( !v14 )
return v15;
LABEL_7:
v29 = 0;
extension_flags = X509_get_extension_flags(a3);
v15 = 1;
if ( (extension_flags & 0x2000) != 0 )
return v15;
signature_nid = X509_get_signature_nid(a3);
if ( (_DWORD)signature_nid )
{
sigid_algs = OBJ_find_sigid_algs(signature_nid, &v29, 0);
v18 = v29;
v19 = -1;
if ( sigid_algs && v29 )
{
v27 = OBJ_nid2sn(v29);
digestbyname = EVP_get_digestbyname(v27);
v19 = -1;
if ( digestbyname )
v19 = 4 * EVP_MD_size(digestbyname);
v18 = v29;
}
}
else
{
v18 = v29;
v19 = -1;
}
if ( a1 )
v20 = ssl_security(a1, v8, v19, v18, a3);
else
v20 = ssl_ctx_security(a2, v8, v19, v18, a3);
if ( v20 )
return 1;
else
return 398;
}