//
// PKCS12_item_pack_safebag from 0xad00a0 to 0xad018c (236 bytes)
//
// 3 xrefs:
// > PKCS12_SAFEBAG_create_cert @ 0xa3a9e8
// > PKCS12_SAFEBAG_create_crl @ 0xa3aa00
// > ??> @ 0x7f39c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:09:23 +0000
//
_DWORD *__fastcall PKCS12_item_pack_safebag(size_t *a1, unsigned __int8 *a2, unsigned int a3, unsigned int a4)
{
_DWORD *v8; // r4
_DWORD *v9; // r0
v8 = PKCS12_BAGS_new();
if ( !v8 )
{
ERR_put_error(35, 117, 65, (int)"crypto/pkcs12/p12_add.c", 24);
return v8;
}
*v8 = OBJ_nid2obj(a3);
if ( !ASN1_item_pack(a1, a2, v8 + 1) )
{
ERR_put_error(35, 117, 65, (int)"crypto/pkcs12/p12_add.c", 29);
LABEL_8:
PKCS12_BAGS_free(v8);
return nullptr;
}
v9 = PKCS12_SAFEBAG_new();
if ( !v9 )
{
ERR_put_error(35, 117, 65, (int)"crypto/pkcs12/p12_add.c", 33);
goto LABEL_8;
}
v9[1] = v8;
v8 = v9;
*v9 = OBJ_nid2obj(a4);
return v8;
}