//
// d2i_PKCS8PrivateKey_bio from 0x10e2bd4 to 0x10e2cec (280 bytes)
//
// 2 xrefs:
// > d2i_PKCS8PrivateKey_fp @ 0x10e2d20
// > ??> @ 0x67ed0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:17:49 +0000
//
__int64 __fastcall d2i_PKCS8PrivateKey_bio(
__int64 a1,
__int64 *a2,
__int64 (__fastcall *a3)(char *, __int64, _QWORD, char *),
char *a4)
{
__int64 v6; // x19
signed int v7; // w2
__int64 v8; // x20
__int64 v9; // x19
char v12[1024]; // [xsp+40h] [xbp+40h] BYREF
v6 = d2i_PKCS8_bio(a1, 0);
if ( !v6 )
return 0;
if ( a3 )
v7 = a3(v12, 1024, 0, a4);
else
v7 = PEM_def_callback(v12, 0x400u, 0, a4);
if ( v7 <= 0 )
{
ERR_put_error(9, 120, 104, (__int64)"crypto/pem/pem_pk8.c", 128);
X509_SIG_free(v6);
return 0;
}
v8 = PKCS8_decrypt(v6, (__int64)v12, v7);
X509_SIG_free(v6);
if ( !v8 )
return 0;
v9 = EVP_PKCS82PKEY(v8);
PKCS8_PRIV_KEY_INFO_free(v8);
if ( !v9 )
return 0;
if ( a2 )
{
EVP_PKEY_free(*a2);
*a2 = v9;
}
return v9;
}