//
// X509_load_crl_file from 0x1062e78 to 0x106302c (436 bytes)
//
// 3 xrefs:
// > sub_E2DA90 @ 0xe2e2d0
// > sub_10622C8 @ 0x10625a0
// > ??> @ 0x62770
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:16:51 +0000
//
__int64 __fastcall X509_load_crl_file(__int64 a1, __int64 a2, int a3)
{
void *v6; // x0
__int64 v7; // x0
_QWORD *v8; // x22
__int64 bio_X509_CRL; // x19
unsigned int v10; // w20
if ( !a2 )
return 1;
v6 = BIO_s_file();
v7 = BIO_new((__int64)v6);
v8 = (_QWORD *)v7;
if ( v7 && (int)BIO_ctrl(v7, 0x6Cu, 3, a2) > 0 )
{
if ( a3 == 1 )
{
v10 = 0;
while ( 1 )
{
bio_X509_CRL = PEM_read_bio_X509_CRL((__int64)v8, 0, 0, 0);
if ( !bio_X509_CRL )
break;
++v10;
if ( !(unsigned int)X509_STORE_add_crl(*(_QWORD *)(a1 + 24), bio_X509_CRL) )
{
v10 = 0;
goto LABEL_7;
}
X509_CRL_free(bio_X509_CRL);
}
if ( (ERR_peek_last_error() & 0xFFF) == 0x6C && v10 )
{
ERR_clear_error();
}
else
{
v10 = 0;
ERR_put_error(11, 112, 9, (__int64)"crypto/x509/by_file.c", 157);
}
}
else if ( a3 == 2 )
{
bio_X509_CRL = d2i_X509_CRL_bio(v8, 0);
if ( bio_X509_CRL )
{
v10 = X509_STORE_add_crl(*(_QWORD *)(a1 + 24), bio_X509_CRL);
}
else
{
v10 = 0;
ERR_put_error(11, 112, 13, (__int64)"crypto/x509/by_file.c", 172);
}
}
else
{
bio_X509_CRL = 0;
v10 = 0;
ERR_put_error(11, 112, 100, (__int64)"crypto/x509/by_file.c", 180);
}
}
else
{
bio_X509_CRL = 0;
ERR_put_error(11, 112, 2, (__int64)"crypto/x509/by_file.c", 144);
v10 = 0;
}
LABEL_7:
X509_CRL_free(bio_X509_CRL);
BIO_free(v8);
return v10;
}