//
// PKCS7_add_signature from 0xa3e27c to 0xa3e33c (192 bytes)
//
// 1 xrefs:
// > ??> @ 0x7fa2c
//
// 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:12 +0000
//
_DWORD *__fastcall PKCS7_add_signature(int a1, int a2, int a3, int a4)
{
int digestbyname; // r6
_DWORD *v8; // r0
_DWORD *v9; // r4
char *v11; // r0
unsigned int v12; // [sp+Ch] [bp-4h] BYREF
digestbyname = a4;
if ( !a4 )
{
if ( EVP_PKEY_get_default_digest_nid(a3, (int)&v12) > 0 )
{
v11 = OBJ_nid2sn(v12);
digestbyname = EVP_get_digestbyname((int)v11);
if ( digestbyname )
goto LABEL_2;
ERR_put_error(33, 131, 151, (int)"crypto/pkcs7/pk7_lib.c", 361);
}
v9 = nullptr;
goto LABEL_11;
}
LABEL_2:
v8 = PKCS7_SIGNER_INFO_new();
v9 = v8;
if ( v8 && PKCS7_SIGNER_INFO_set(v8, a2, a3, digestbyname) && PKCS7_add_signer(a1, (int)v9) )
return v9;
LABEL_11:
PKCS7_SIGNER_INFO_free(v9);
return nullptr;
}