//
// X509_STORE_CTX_get1_crls from 0xde7db8 to 0xde7f38 (384 bytes)
//
// 3 xrefs:
// > ??> @ 0x8c310
// > X509_STORE_CTX_init @ 0xdedc48
// > ??> @ 0x122cc40
//
// 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
//
void **__fastcall X509_STORE_CTX_get1_crls(__int64 *a1, __int64 a2)
{
void **v4; // x21
_QWORD *v5; // x20
int v6; // w19
int v7; // w23
int v8; // w1
__int64 v9; // x20
int v11; // [xsp+4Ch] [xbp+4Ch] BYREF
v4 = (void **)OPENSSL_sk_new_null();
v5 = X509_OBJECT_new();
if ( v5 )
{
v6 = v4 == nullptr;
if ( v4 )
{
if ( (unsigned int)X509_STORE_CTX_get_by_subject(a1, 2, a2, (__int64)v5) )
{
X509_OBJECT_free(v5);
CRYPTO_THREAD_write_lock(*(pthread_rwlock_t **)(*a1 + 144));
v7 = sub_DE7324(*(unsigned int **)(*a1 + 8), 2, a2, &v11);
if ( v7 < 0 )
{
CRYPTO_THREAD_unlock(*(pthread_rwlock_t **)(*a1 + 144));
OPENSSL_sk_free(v4);
}
else
{
if ( v11 <= 0 )
{
LABEL_11:
CRYPTO_THREAD_unlock(*(pthread_rwlock_t **)(*a1 + 144));
return v4;
}
while ( 1 )
{
v8 = v6 + v7;
++v6;
v9 = *(_QWORD *)(OPENSSL_sk_value(*(_QWORD *)(*a1 + 8), v8) + 8);
X509_CRL_up_ref(v9);
if ( !(unsigned int)OPENSSL_sk_push((int *)v4, v9) )
break;
if ( v11 <= v6 )
goto LABEL_11;
}
CRYPTO_THREAD_unlock(*(pthread_rwlock_t **)(*a1 + 144));
X509_CRL_free(v9);
OPENSSL_sk_pop_free((int *)v4, (void (__fastcall *)(__int64))X509_CRL_free);
}
return nullptr;
}
}
}
X509_OBJECT_free(v5);
OPENSSL_sk_free(v4);
return nullptr;
}