//
// EVP_PKEY_set_type_str from 0x80537c to 0x80549c (288 bytes)
//
// 2 xrefs:
// > PEM_read_bio_Parameters @ 0x8237c4
// > ??> @ 0x63adc
//
// 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
//
int __fastcall EVP_PKEY_set_type_str(_DWORD *a1, char *a2, size_t a3)
{
int v6; // r3
void (*v7)(void); // r3
int *str; // r5
int v9; // r1
int v10; // r2
int v12[2]; // [sp+Ch] [bp-8h] BYREF
v12[0] = 0;
if ( a1 )
{
if ( a1[5] )
{
v6 = a1[3];
if ( v6 )
{
v7 = *(void (**)(void))(v6 + 88);
if ( v7 )
{
v7();
a1[5] = 0;
}
}
ENGINE_finish(a1[4]);
a1[4] = 0;
}
if ( !a1[1] && a1[3] )
return 1;
ENGINE_finish(a1[4]);
a1[4] = 0;
}
if ( a2 )
str = (int *)EVP_PKEY_asn1_find_str(v12, a2, a3);
else
str = (int *)EVP_PKEY_asn1_find(v12, 0);
if ( a1 )
{
if ( str )
{
v9 = *str;
v10 = v12[0];
a1[3] = str;
*a1 = v9;
a1[4] = v10;
a1[1] = 0;
return 1;
}
}
else
{
ENGINE_finish(v12[0]);
if ( str )
return 1;
}
ERR_put_error(6, 158, 156, (int)"crypto/evp/p_lib.c", 204);
return 0;
}