//
// PKCS12_item_i2d_encrypt from 0xad09ec to 0xad0b2c (320 bytes)
//
// 3 xrefs:
// > PKCS12_pack_p7encdata @ 0xad0398
// > PKCS8_set0_pbe @ 0xad0b6c
// > ??> @ 0x84e3c
//
// 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
//
int *__fastcall PKCS12_item_i2d_encrypt(int *a1, unsigned __int8 *a2, const char *a3, size_t a4, size_t *a5, int a6)
{
int *v10; // r4
size_t v11; // r0
unsigned int v12; // r5
_BYTE *v14; // [sp+14h] [bp-8h] BYREF
v14 = nullptr;
v10 = (int *)ASN1_OCTET_STRING_new();
if ( !v10 )
{
ERR_put_error(35, 108, 65, (int)"crypto/pkcs12/p12_decr.c", 134);
LABEL_9:
ASN1_OCTET_STRING_free((int)v10);
return nullptr;
}
v11 = ASN1_item_i2d(a5, (int *)&v14, a2);
v12 = v11;
if ( !v14 )
{
ERR_put_error(35, 108, 102, (int)"crypto/pkcs12/p12_decr.c", 139);
goto LABEL_9;
}
if ( !PKCS12_pbe_crypt(a1, a3, a4, v14, v11, v10 + 2, v10, 1) )
{
ERR_put_error(35, 108, 103, (int)"crypto/pkcs12/p12_decr.c", 144);
CRYPTO_free(v14, (int)"crypto/pkcs12/p12_decr.c", 145);
goto LABEL_9;
}
if ( a6 )
OPENSSL_cleanse(v14, v12);
CRYPTO_free(v14, (int)"crypto/pkcs12/p12_decr.c", 150);
return v10;
}