//
// OCSP_request_sign from 0x81db48 to 0x81dc78 (304 bytes)
//
// 1 xrefs:
// > ??> @ 0x6480c
//
// 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_request_sign(int a1, int a2, int a3, int a4, int a5, char a6)
{
int subject_name; // r0
_DWORD *v11; // r0
int v13; // r5
int v14; // r0
subject_name = X509_get_subject_name(a2);
if ( !OCSP_request_set1_name(a1, subject_name) )
goto LABEL_8;
v11 = OCSP_SIGNATURE_new();
*(_DWORD *)(a1 + 16) = v11;
if ( !v11 )
{
LABEL_6:
OCSP_SIGNATURE_free(v11);
*(_DWORD *)(a1 + 16) = 0;
return 0;
}
if ( a3 )
{
if ( !X509_check_private_key(a2, a3) )
{
ERR_put_error(39, 110, 110, (int)"crypto/ocsp/ocsp_cl.c", 112);
v11 = *(_DWORD **)(a1 + 16);
goto LABEL_6;
}
if ( !ASN1_item_sign(OCSP_REQINFO_it, *(_DWORD *)(a1 + 16), 0, *(_DWORD *)(*(_DWORD *)(a1 + 16) + 8), a1, a3, a4) )
{
LABEL_8:
v11 = *(_DWORD **)(a1 + 16);
goto LABEL_6;
}
}
v13 = a6 & 1;
if ( (a6 & 1) == 0 )
{
if ( !OCSP_request_add1_cert(a1, a2) )
goto LABEL_8;
while ( v13 < OPENSSL_sk_num(a5) )
{
v14 = OPENSSL_sk_value(a5, v13++);
if ( !OCSP_request_add1_cert(a1, v14) )
goto LABEL_8;
}
}
return 1;
}