//
// cms_DigestAlgorithm_init_bio from 0xa8a1f8 to 0xa8a2bc (196 bytes)
//
// 3 xrefs:
// > cms_SignedData_init_bio @ 0xa8c300
// > cms_DigestedData_init_bio @ 0xae42dc
// > ??> @ 0x83f0c
//
// 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:54 +0000
//
_DWORD *__fastcall cms_DigestAlgorithm_init_bio(_DWORD *a1)
{
char *v1; // r0
char *v2; // r0
int digestbyname; // r5
int v4; // r0
_DWORD *v5; // r0
_DWORD *v6; // r4
int v8; // [sp+Ch] [bp-8h] BYREF
X509_ALGOR_get0(&v8, nullptr, nullptr, a1);
v1 = OBJ_obj2nid(v8);
v2 = OBJ_nid2sn((unsigned int)v1);
digestbyname = EVP_get_digestbyname((int)v2);
if ( digestbyname )
{
v4 = BIO_f_md();
v5 = BIO_new(v4);
v6 = v5;
if ( v5 && BIO_ctrl(v5, 111, 0, digestbyname) )
return v6;
ERR_put_error(46, 116, 119, (int)"crypto/cms/cms_lib.c", 300);
}
else
{
v6 = nullptr;
ERR_put_error(46, 116, 149, (int)"crypto/cms/cms_lib.c", 295);
}
BIO_free(v6);
return nullptr;
}