//
// sub_842228 from 0x842228 to 0x8422d8 (176 bytes)
//
// 12 xrefs:
// > X509_STORE_CTX_init @ 0x845e70
// > X509_STORE_CTX_init @ 0x845e74
// > X509_STORE_CTX_init @ 0x845f48
// > X509_STORE_CTX_init @ 0x845f64
// > X509_STORE_CTX_init @ 0x846038
// > X509_STORE_CTX_init @ 0x846040
// > X509_STORE_CTX_init @ 0x8460dc
// > X509_STORE_CTX_init @ 0x8460e0
// > ??> @ 0x846120
// > ??> @ 0x846148
// > ??> @ 0x846168
// > ??> @ 0x846184
//
// 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 sub_842228(int a1, int a2)
{
int result; // r0
int v5; // [sp+Ch] [bp-8h] BYREF
if ( (*(_DWORD *)(*(_DWORD *)(a1 + 16) + 12) & 0x10) != 0
|| (*(_DWORD *)(a2 + 72) & 0x200) == 0
|| (*(_DWORD *)(a1 + 96) = 36, (result = (*(int (__fastcall **)(_DWORD, int))(a1 + 28))(0, a1)) != 0) )
{
if ( X509_CRL_get0_by_cert(a2, &v5) )
{
if ( *(_DWORD *)(v5 + 28) == 8 )
{
return 2;
}
else
{
*(_DWORD *)(a1 + 96) = 23;
return (*(int (__fastcall **)(_DWORD, int))(a1 + 28))(0, a1) != 0;
}
}
else
{
return 1;
}
}
return result;
}