//
// PKCS12_item_pack_safebag from 0xe655b0 to 0xe656a8 (248 bytes)
//
// 3 xrefs:
// > PKCS12_SAFEBAG_create_cert @ 0xdcb66c
// > PKCS12_SAFEBAG_create_crl @ 0xdcb680
// > ??> @ 0xc69c0
//
// 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
//
_QWORD *__fastcall PKCS12_item_pack_safebag(__int64 a1, __int64 a2, unsigned int a3, unsigned int a4)
{
_QWORD *v6; // x0
_QWORD *v7; // x19
_QWORD *v8; // x0
__int64 v10; // x0
v6 = (_QWORD *)PKCS12_BAGS_new();
v7 = v6;
if ( !v6 )
{
ERR_put_error(35, 117, 65, (__int64)"crypto/pkcs12/p12_add.c", 24);
return v7;
}
*v6 = OBJ_nid2obj(a3);
if ( !ASN1_item_pack(a1, a2, v7 + 1) )
{
ERR_put_error(35, 117, 65, (__int64)"crypto/pkcs12/p12_add.c", 29);
LABEL_8:
v10 = (__int64)v7;
v7 = nullptr;
PKCS12_BAGS_free(v10);
return v7;
}
v8 = (_QWORD *)PKCS12_SAFEBAG_new();
if ( !v8 )
{
ERR_put_error(35, 117, 65, (__int64)"crypto/pkcs12/p12_add.c", 33);
goto LABEL_8;
}
v8[1] = v7;
v7 = v8;
*v8 = OBJ_nid2obj(a4);
return v7;
}