//
// CMS_add0_CertificateChoices from 0x87579c to 0x87586c (208 bytes)
//
// 2 xrefs:
// > CMS_add0_cert @ 0x875954
// > ??> @ 0x6a4ac
//
// 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
//
_DWORD *__fastcall CMS_add0_CertificateChoices(int *a1)
{
char *v2; // r0
int **v3; // r5
_DWORD *v4; // r4
int v5; // r5
_DWORD *result; // r0
int *v7; // r0
v2 = OBJ_obj2nid(*a1);
if ( v2 != (_BYTE *)&dword_14 + 2 )
{
if ( v2 == (_BYTE *)&dword_14 + 3 )
{
v3 = *(int ***)(a1[1] + 4);
if ( v3 )
goto LABEL_4;
}
else
{
ERR_put_error(46, 128, 152, (int)"crypto/cms/cms_lib.c", 354);
}
return nullptr;
}
v3 = (int **)(a1[1] + 12);
if ( a1[1] == -12 )
return nullptr;
LABEL_4:
if ( !*v3 )
{
v7 = OPENSSL_sk_new_null();
*v3 = v7;
if ( !v7 )
return nullptr;
}
v4 = ASN1_item_new((int)CMS_CertificateChoices_it);
if ( !v4 )
return nullptr;
v5 = OPENSSL_sk_push(*v3, (int)v4);
result = v4;
if ( !v5 )
{
ASN1_item_free(v4, CMS_CertificateChoices_it);
return nullptr;
}
return result;
}