//
// cms_DigestAlgorithm_init_bio from 0xe1ff20 to 0xe1ffe4 (196 bytes)
//
// 3 xrefs:
// > cms_SignedData_init_bio @ 0xe21fc4
// > cms_DigestedData_init_bio @ 0xe7af78
// > ??> @ 0x53ee0
//
// 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
//
_QWORD *__fastcall cms_DigestAlgorithm_init_bio(_QWORD *a1)
{
unsigned int v1; // w0
char *v2; // x0
__int64 digestbyname; // x20
__int64 v4; // x0
__int64 v5; // x0
_QWORD *v6; // x19
__int64 v8; // [xsp+28h] [xbp+28h] BYREF
X509_ALGOR_get0((__int64)&v8, nullptr, nullptr, a1);
v1 = OBJ_obj2nid(v8);
v2 = OBJ_nid2sn(v1);
digestbyname = EVP_get_digestbyname((__int64)v2);
if ( digestbyname )
{
v4 = BIO_f_md();
v5 = BIO_new(v4);
v6 = (_QWORD *)v5;
if ( v5 && BIO_ctrl(v5, 0x6Fu, 0, digestbyname) )
return v6;
ERR_put_error(46, 116, 119, (__int64)"crypto/cms/cms_lib.c", 300);
}
else
{
v6 = nullptr;
ERR_put_error(46, 116, 149, (__int64)"crypto/cms/cms_lib.c", 295);
}
BIO_free(v6);
return nullptr;
}