//
// SSL_use_certificate_file from 0xd443ac to 0xd44508 (348 bytes)
//
// 1 xrefs:
// > ??> @ 0x7d418
//
// 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_certificate_file(__int64 a1, __int64 a2, int a3)
{
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x19
__int64 bio_X509; // x20
unsigned int v10; // w21
__int64 v12; // x2
v6 = BIO_s_file();
v7 = BIO_new(v6);
v8 = v7;
if ( !v7 )
{
bio_X509 = 0;
v10 = 0;
ERR_put_error(20, 200, 7, "ssl/ssl_rsa.c", 45);
goto LABEL_6;
}
if ( (int)BIO_ctrl(v7, 108, 3, a2) <= 0 )
{
bio_X509 = 0;
ERR_put_error(20, 200, 2, "ssl/ssl_rsa.c", 50);
v10 = 0;
goto LABEL_6;
}
if ( a3 == 2 )
{
bio_X509 = d2i_X509_bio(v8, 0);
v12 = 13;
}
else
{
if ( a3 != 1 )
{
bio_X509 = 0;
v10 = 0;
ERR_put_error(20, 200, 124, "ssl/ssl_rsa.c", 61);
goto LABEL_6;
}
bio_X509 = PEM_read_bio_X509(
v8,
0,
*(_QWORD *)(*(_QWORD *)(a1 + 440) + 168LL),
*(_QWORD *)(*(_QWORD *)(a1 + 440) + 176LL));
v12 = 9;
}
if ( bio_X509 )
{
v10 = SSL_use_certificate(a1, bio_X509);
}
else
{
v10 = 0;
ERR_put_error(20, 200, v12, "ssl/ssl_rsa.c", 66);
}
LABEL_6:
X509_free(bio_X509);
BIO_free(v8);
return v10;
}