//
// EVP_PKEY_asn1_find from 0xd688d0 to 0xd689d4 (260 bytes)
//
// 6 xrefs:
// > EVP_PKEY_set_type @ 0xdac128
// > EVP_PKEY_set_type @ 0xdac178
// > EVP_PKEY_set_type_str @ 0xdac3b8
// > EVP_PKEY_type @ 0xdac778
// > X509_signature_print @ 0xde52bc
// > ??> @ 0x5d480
//
// 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
//
__int64 __fastcall EVP_PKEY_asn1_find(__int64 *a1, unsigned int a2)
{
__int64 *v4; // x0
__int64 v5; // x19
unsigned int v6; // w0
__int64 pkey_asn1_meth_engine; // x0
_DWORD *v9; // [xsp+50h] [xbp+50h] BYREF
_DWORD v10[54]; // [xsp+58h] [xbp+58h] BYREF
while ( 1 )
{
v9 = v10;
v10[0] = a2;
if ( !qword_125D508 )
break;
v6 = OPENSSL_sk_find(qword_125D508, v10);
if ( (v6 & 0x80000000) != 0 )
break;
v5 = OPENSSL_sk_value(qword_125D508, v6);
if ( !v5 )
{
v5 = 0;
goto LABEL_10;
}
LABEL_4:
if ( (*(_QWORD *)(v5 + 8) & 1) == 0 )
goto LABEL_10;
a2 = *(_DWORD *)(v5 + 4);
}
v4 = (__int64 *)OBJ_bsearch_(&v9, &off_1238890, 13, 8, sub_D68858);
if ( v4 )
{
v5 = *v4;
if ( *v4 )
goto LABEL_4;
}
v5 = 0;
LABEL_10:
if ( a1 && (pkey_asn1_meth_engine = ENGINE_get_pkey_asn1_meth_engine(a2), (*a1 = pkey_asn1_meth_engine) != 0) )
return ENGINE_get_pkey_asn1_meth(pkey_asn1_meth_engine, a2);
else
return v5;
}