//
// X509v3_add_ext from 0xde9838 to 0xde9948 (272 bytes)
//
// 10 xrefs:
// > OCSP_REQUEST_add_ext @ 0xdc3cf0
// > OCSP_ONEREQ_add_ext @ 0xdc3d50
// > OCSP_BASICRESP_add_ext @ 0xdc3db0
// > OCSP_SINGLERESP_add_ext @ 0xdc3e10
// > X509_CRL_add_ext @ 0xde7174
// > X509_add_ext @ 0xde71c4
// > X509_REVOKED_add_ext @ 0xde7224
// > X509V3_EXT_add_nconf_sk @ 0xdfb364
// > ??> @ 0xe55b3c
// > ??> @ 0x90870
//
// 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
//
void **__fastcall X509v3_add_ext(void ***a1, __int64 a2, int a3)
{
void **v6; // x19
int v7; // w0
__int64 v8; // x22
void **result; // x0
if ( !a1 )
{
v6 = nullptr;
v8 = 0;
ERR_put_error(11, 104, 67, (__int64)"crypto/x509/x509_v3.c", 104);
goto LABEL_14;
}
v6 = *a1;
if ( !*a1 )
{
v6 = (void **)OPENSSL_sk_new_null();
if ( !v6 )
{
v8 = 0;
LABEL_13:
ERR_put_error(11, 104, 65, (__int64)"crypto/x509/x509_v3.c", 128);
LABEL_14:
X509_EXTENSION_free(v8);
OPENSSL_sk_free(v6);
return nullptr;
}
}
v7 = OPENSSL_sk_num((unsigned int *)v6);
if ( v7 < a3 || a3 < 0 )
a3 = v7;
v8 = X509_EXTENSION_dup(a2);
if ( !v8 )
goto LABEL_14;
if ( !(unsigned int)OPENSSL_sk_insert((int *)v6, v8, a3) )
goto LABEL_13;
result = v6;
if ( !*a1 )
*a1 = v6;
return result;
}