//
// X509_add1_trust_object from 0xdf2cb8 to 0xdf2d60 (168 bytes)
//
// 1 xrefs:
// > ??> @ 0x7bf60
//
// 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 X509_add1_trust_object(__int64 a1, __int64 a2)
{
__int64 v3; // x19
int **v4; // x20
int *v5; // x0
__int64 v7; // x0
if ( a2 )
{
v3 = OBJ_dup(a2);
if ( !v3 )
return 0;
}
else
{
v3 = 0;
}
if ( !a1
|| (v4 = *(int ***)(a1 + 312)) == nullptr
&& (v7 = X509_CERT_AUX_new(), *(_QWORD *)(a1 + 312) = v7, (v4 = (int **)v7) == nullptr)
|| (v5 = *v4) == nullptr && (v5 = (int *)OPENSSL_sk_new_null(), (*v4 = v5) == nullptr)
|| v3 && !(unsigned int)OPENSSL_sk_push(v5, v3) )
{
ASN1_OBJECT_free(v3);
return 0;
}
return 1;
}