//
// sub_1070120 from 0x1070120 to 0x1070230 (272 bytes)
//
// 2 xrefs:
// > sub_1070230 @ 0x107027c
// > X509_PUBKEY_get0 @ 0x1070418
//
// 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:00 +0000
//
__int64 __fastcall sub_1070120(_QWORD *a1, __int64 **a2)
{
_DWORD *v4; // x19
unsigned int v5; // w0
unsigned int (__fastcall *v6)(_DWORD *, __int64 **); // x2
v4 = EVP_PKEY_new();
if ( !v4 )
{
ERR_put_error(11, 148, 65, (__int64)"crypto/x509/x_pubkey.c", 108);
return 0xFFFFFFFFLL;
}
v5 = OBJ_obj2nid(**a2);
if ( !(unsigned int)EVP_PKEY_set_type((__int64)v4, v5) )
{
ERR_put_error(11, 148, 111, (__int64)"crypto/x509/x_pubkey.c", 113);
goto LABEL_8;
}
v6 = *(unsigned int (__fastcall **)(_DWORD *, __int64 **))(*((_QWORD *)v4 + 2) + 32LL);
if ( !v6 )
{
ERR_put_error(11, 148, 124, (__int64)"crypto/x509/x_pubkey.c", 128);
goto LABEL_8;
}
if ( !v6(v4, a2) )
{
ERR_put_error(11, 148, 125, (__int64)"crypto/x509/x_pubkey.c", 124);
LABEL_8:
EVP_PKEY_free((__int64)v4);
return 0;
}
*a1 = v4;
return 1;
}