//
// SSL_use_RSAPrivateKey_file from 0x79bca8 to 0x79bdfc (340 bytes)
//
// 1 xrefs:
// > ??> @ 0x5c88c
//
// 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 SSL_use_RSAPrivateKey_file(int a1, int a2, int a3)
{
int v6; // r0
int v7; // r0
int v8; // r5
int v9; // r4
int bio_RSAPrivateKey; // r0
int v12; // r2
int v13; // r6
int v14; // r0
v6 = BIO_s_file();
v7 = BIO_new(v6);
v8 = v7;
if ( !v7 )
{
ERR_put_error(20, 206, 7, "ssl/ssl_rsa.c", 176);
v9 = 0;
goto LABEL_6;
}
if ( BIO_ctrl(v7, 108, 3, a2) <= 0 )
{
ERR_put_error(20, 206, 2, "ssl/ssl_rsa.c", 181);
v9 = 0;
goto LABEL_6;
}
if ( a3 == 2 )
{
v14 = d2i_RSAPrivateKey_bio(v8, 0);
v12 = 13;
v13 = v14;
}
else
{
if ( a3 != 1 )
{
ERR_put_error(20, 206, 124, "ssl/ssl_rsa.c", 194);
v9 = 0;
goto LABEL_6;
}
bio_RSAPrivateKey = PEM_read_bio_RSAPrivateKey(
v8,
0,
*(_DWORD *)(*(_DWORD *)(a1 + 276) + 108),
*(_DWORD *)(*(_DWORD *)(a1 + 276) + 112));
v12 = 9;
v13 = bio_RSAPrivateKey;
}
if ( v13 )
{
v9 = SSL_use_RSAPrivateKey(a1, v13);
RSA_free(v13);
}
else
{
v9 = 0;
ERR_put_error(20, 206, v12, "ssl/ssl_rsa.c", 198);
}
LABEL_6:
BIO_free(v8);
return v9;
}