//
// SSL_use_PrivateKey_file from 0xd449fc to 0xd44b7c (384 bytes)
//
// 9 xrefs:
// > sub_D61D58 @ 0xd61d98
// > SSL_CONF_CTX_finish @ 0xd63160
// > SSL_CONF_CTX_finish @ 0xd631bc
// > SSL_CONF_CTX_finish @ 0xd63200
// > SSL_CONF_CTX_finish @ 0xd63244
// > SSL_CONF_CTX_finish @ 0xd63288
// > SSL_CONF_CTX_finish @ 0xd632cc
// > SSL_CONF_CTX_finish @ 0xd63310
// > ??> @ 0x7e768
//
// 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 SSL_use_PrivateKey_file(__int64 a1, __int64 a2, int a3)
{
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x19
__int64 bio_PrivateKey; // x21
__int64 v11; // x2
unsigned int v12; // w20
v6 = BIO_s_file();
v7 = BIO_new(v6);
v8 = v7;
if ( v7 )
{
if ( (int)BIO_ctrl(v7, 108, 3, a2) <= 0 )
{
ERR_put_error(20, 203, 2, "ssl/ssl_rsa.c", 251);
goto LABEL_6;
}
if ( a3 == 1 )
{
bio_PrivateKey = PEM_read_bio_PrivateKey(
v8,
0,
*(_QWORD *)(*(_QWORD *)(a1 + 440) + 168LL),
*(_QWORD *)(*(_QWORD *)(a1 + 440) + 176LL));
v11 = 9;
}
else
{
if ( a3 != 2 )
{
ERR_put_error(20, 203, 124, "ssl/ssl_rsa.c", 264);
LABEL_6:
BIO_free(v8);
return 0;
}
bio_PrivateKey = d2i_PrivateKey_bio(v8, 0);
v11 = 13;
}
if ( !bio_PrivateKey )
{
ERR_put_error(20, 203, v11, "ssl/ssl_rsa.c", 268);
goto LABEL_6;
}
v12 = SSL_use_PrivateKey(a1, bio_PrivateKey);
EVP_PKEY_free(bio_PrivateKey);
BIO_free(v8);
return v12;
}
else
{
ERR_put_error(20, 203, 7, "ssl/ssl_rsa.c", 246);
BIO_free(0);
return 0;
}
}