//
// OCSP_check_validity from 0xa32b14 to 0xa32cd8 (452 bytes)
//
// 2 xrefs:
// > sub_852C2C @ 0x853766
// > ??> @ 0x67fbc
//
// 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:06 +0000
//
int __fastcall OCSP_check_validity(int a1, int a2, int a3, int a4)
{
int v8; // r4
time_t timer; // [sp+8h] [bp-Ch] BYREF
int v11; // [sp+Ch] [bp-8h] BYREF
time(&timer);
v8 = ASN1_GENERALIZEDTIME_check(a1);
if ( v8 )
{
v11 = timer + a3;
if ( X509_cmp_time(a1, &v11) > 0 )
{
ERR_put_error(39, 115, 126, (int)"crypto/ocsp/ocsp_cl.c", 320);
v8 = 0;
}
else
{
v8 = 1;
}
if ( a4 >= 0 )
{
v11 = timer - a4;
if ( X509_cmp_time(a1, &v11) < 0 )
{
ERR_put_error(39, 115, 127, (int)"crypto/ocsp/ocsp_cl.c", 331);
v8 = 0;
}
}
}
else
{
ERR_put_error(39, 115, 123, (int)"crypto/ocsp/ocsp_cl.c", 315);
}
if ( !a2 )
return v8;
if ( ASN1_GENERALIZEDTIME_check(a2) )
{
v11 = timer - a3;
if ( X509_cmp_time(a2, &v11) < 0 )
{
ERR_put_error(39, 115, 125, (int)"crypto/ocsp/ocsp_cl.c", 347);
v8 = 0;
}
}
else
{
v8 = 0;
ERR_put_error(39, 115, 122, (int)"crypto/ocsp/ocsp_cl.c", 342);
}
if ( ASN1_STRING_cmp(a2, a1) >= 0 )
return v8;
ERR_put_error(39, 115, 124, (int)"crypto/ocsp/ocsp_cl.c", 355);
return 0;
}