//
// OCSP_check_validity from 0x81df14 to 0x81e0d8 (452 bytes)
//
// 2 xrefs:
// > sub_642BAC @ 0x6436e6
// > ??> @ 0x5508c
//
// 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 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;
}