//
// PKCS8_set0_pbe from 0x8bbb3c to 0x8bbbfc (192 bytes)
//
// 2 xrefs:
// > PKCS8_encrypt @ 0x8bbc80
// > ??> @ 0x6b46c
//
// 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 PKCS8_set0_pbe(const char *a1, size_t a2, size_t *a3, int *a4)
{
int *v5; // r6
_DWORD *result; // r0
v5 = PKCS12_item_i2d_encrypt(a4, PKCS8_PRIV_KEY_INFO_it, a1, a2, a3, 1);
if ( v5 )
{
result = CRYPTO_zalloc(byte_8, (int)"crypto/pkcs12/p12_p8e.c", 58);
if ( result )
{
*result = a4;
result[1] = v5;
}
else
{
ERR_put_error(35, 132, 65, (int)"crypto/pkcs12/p12_p8e.c", 61);
ASN1_OCTET_STRING_free((int)v5);
return nullptr;
}
}
else
{
ERR_put_error(35, 132, 103, (int)"crypto/pkcs12/p12_p8e.c", 54);
return nullptr;
}
return result;
}