//
// EVP_PKEY_set_type from 0xa19d44 to 0xa19e40 (252 bytes)
//
// 7 xrefs:
// > tls_process_key_exchange @ 0x9b8730
// > d2i_PrivateKey @ 0x9d8724
// > EVP_PKCS82PKEY @ 0xa1896c
// > EVP_PKEY_copy_parameters @ 0xa19f14
// > EVP_PKEY_assign @ 0xa1a0b4
// > sub_A5F068 @ 0xa5f098
// > ??> @ 0x76d4c
//
// 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:07:51 +0000
//
int __fastcall EVP_PKEY_set_type(_DWORD *a1, int a2)
{
int v4; // r3
void (*v5)(void); // r3
int *v6; // r0
int v7; // r2
int v8; // r3
int v10; // r4
int v11; // [sp+Ch] [bp-4h] BYREF
v11 = 0;
if ( a1 )
{
if ( a1[5] )
{
v4 = a1[3];
if ( v4 )
{
v5 = *(void (**)(void))(v4 + 88);
if ( v5 )
{
v5();
a1[5] = 0;
}
}
ENGINE_finish(a1[4]);
a1[4] = 0;
}
if ( a2 == a1[1] && a1[3] )
return 1;
ENGINE_finish(a1[4]);
a1[4] = 0;
v6 = (int *)EVP_PKEY_asn1_find(&v11, a2);
if ( v6 )
{
v7 = *v6;
v8 = v11;
a1[3] = v6;
*a1 = v7;
a1[1] = a2;
a1[4] = v8;
return 1;
}
}
else
{
v10 = EVP_PKEY_asn1_find(&v11, a2);
ENGINE_finish(v11);
if ( v10 )
return 1;
}
ERR_put_error(6, 158, 156, (int)"crypto/evp/p_lib.c", 204);
return 0;
}