//
// X509_OBJECT_retrieve_match from 0xa54ae4 to 0xa54bd8 (244 bytes)
//
// 3 xrefs:
// > X509_STORE_add_cert @ 0xa54c1c
// > X509_STORE_add_crl @ 0xa54d20
// > ??> @ 0x80b2c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:08:25 +0000
//
int __fastcall X509_OBJECT_retrieve_match(_DWORD *a1, int *a2)
{
signed int v4; // r4
int v5; // r0
int v6; // r3
_DWORD *v7; // r0
_DWORD *v8; // r5
v4 = OPENSSL_sk_find((int)a1, (int)a2);
if ( v4 != -1 )
{
if ( (unsigned int)(*a2 - 1) > 1 )
return OPENSSL_sk_value(a1, v4);
while ( 1 )
{
if ( v4 >= OPENSSL_sk_num((int)a1) )
return 0;
v7 = (_DWORD *)OPENSSL_sk_value(a1, v4);
v6 = *v7;
v8 = v7;
if ( *v7 != *a2 )
return 0;
if ( v6 == 1 )
{
v5 = X509_subject_name_cmp(v7[1], a2[1]);
}
else
{
if ( v6 != 2 )
goto LABEL_9;
v5 = X509_CRL_cmp(v7[1], a2[1]);
}
if ( v5 )
return 0;
v6 = *a2;
LABEL_9:
if ( v6 == 1 )
{
if ( !X509_cmp(v8[1], a2[1]) )
return (int)v8;
}
else if ( v6 != 2 || !X509_CRL_match(v8[1], a2[1]) )
{
return (int)v8;
}
++v4;
}
}
return 0;
}