//
// CMS_get1_crls from 0xe2057c to 0xe206b4 (312 bytes)
//
// 1 xrefs:
// > ??> @ 0x9ac68
//
// 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 CMS_get1_crls(__int64 *a1)
{
int v2; // w0
__int64 v3; // x21
unsigned int **v4; // x21
int v5; // w19
int *v6; // x22
bool v7; // cc
int v8; // w1
__int64 v9; // x0
__int64 v10; // x20
int *v12; // x0
v2 = OBJ_obj2nid(*a1);
if ( v2 != 22 )
{
if ( v2 == 23 )
{
v3 = *(_QWORD *)(a1[1] + 8);
if ( v3 )
{
v4 = (unsigned int **)(v3 + 8);
goto LABEL_5;
}
}
else
{
ERR_put_error(46, 132, 152, (__int64)"crypto/cms/cms_lib.c", 431);
}
return nullptr;
}
v4 = (unsigned int **)(a1[1] + 32);
if ( a1[1] == -32 )
return nullptr;
LABEL_5:
v5 = 0;
v6 = nullptr;
while ( 1 )
{
v7 = v5 < (int)OPENSSL_sk_num(*v4);
v8 = v5++;
if ( !v7 )
return v6;
while ( 1 )
{
v9 = OPENSSL_sk_value((__int64)*v4, v8);
v10 = v9;
if ( *(_DWORD *)v9 )
break;
if ( v6 )
{
if ( !(unsigned int)OPENSSL_sk_push(v6, *(_QWORD *)(v9 + 8)) )
goto LABEL_17;
}
else
{
v12 = (int *)OPENSSL_sk_new_null();
v6 = v12;
if ( !v12 )
return nullptr;
if ( !(unsigned int)OPENSSL_sk_push(v12, *(_QWORD *)(v10 + 8)) )
{
LABEL_17:
OPENSSL_sk_pop_free(v6, (void (__fastcall *)(__int64))X509_CRL_free);
return nullptr;
}
}
X509_CRL_up_ref(*(_QWORD *)(v10 + 8));
v7 = v5 < (int)OPENSSL_sk_num(*v4);
v8 = v5++;
if ( !v7 )
return v6;
}
}
}