//
// X509_EXTENSION_create_by_OBJ from 0x841a84 to 0x841b94 (272 bytes)
//
// 3 xrefs:
// > X509_EXTENSION_create_by_NID @ 0x841bcc
// > sub_853810 @ 0x853900
// > ??> @ 0x6745c
//
// 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
//
const char ***__fastcall X509_EXTENSION_create_by_OBJ(const char ****a1, const char **a2, int a3, _DWORD *a4)
{
const char ***v8; // r4
const char ***v10; // r0
if ( a1 && (v8 = *a1) != nullptr )
{
if ( !X509_EXTENSION_set_object(*a1, a2) || !X509_EXTENSION_set_critical((int)v8, a3) )
goto LABEL_4;
}
else
{
v10 = (const char ***)X509_EXTENSION_new();
v8 = v10;
if ( !v10 )
{
ERR_put_error(11, 109, 65, (int)"crypto/x509/x509_v3.c", 162);
return nullptr;
}
if ( !X509_EXTENSION_set_object(v10, a2) || !X509_EXTENSION_set_critical((int)v8, a3) )
{
LABEL_15:
if ( !a1 )
{
LABEL_6:
X509_EXTENSION_free(v8);
return nullptr;
}
LABEL_4:
if ( *a1 == v8 )
return nullptr;
goto LABEL_6;
}
}
if ( !X509_EXTENSION_set_data((_BOOL4)v8, a4) )
goto LABEL_15;
if ( !a1 || *a1 )
return v8;
*a1 = v8;
return v8;
}