//
// CMS_EncryptedData_set1_key from 0xe7b608 to 0xe7b71c (276 bytes)
//
// 1 xrefs:
// > ??> @ 0x3a0e0
//
// 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
//
__int64 __fastcall CMS_EncryptedData_set1_key(__int64 *a1, char **a2, const void *a3, void *a4)
{
__int64 v5; // x0
char **v6; // x0
__int64 v7; // x4
char **v8; // x1
const void *v9; // x2
void *v10; // x3
int v12; // w0
if ( a3 && a4 )
{
if ( a2 )
{
v5 = ASN1_item_new((__int64)&CMS_EncryptedData_it);
a1[1] = v5;
if ( v5 )
{
v6 = OBJ_nid2obj(0x1Au);
v7 = a1[1];
*a1 = (__int64)v6;
v8 = a2;
v9 = a3;
v10 = a4;
*(_QWORD *)v7 = 0;
return cms_EncryptedContent_init(*(char ****)(v7 + 8), v8, v9, v10);
}
ERR_put_error(46, 123, 65, (__int64)"crypto/cms/cms_enc.c", 193);
}
else
{
v12 = OBJ_obj2nid(*a1);
v8 = nullptr;
v9 = a3;
v10 = a4;
if ( v12 == 26 )
{
v7 = a1[1];
return cms_EncryptedContent_init(*(char ****)(v7 + 8), v8, v9, v10);
}
ERR_put_error(46, 123, 122, (__int64)"crypto/cms/cms_enc.c", 199);
}
}
else
{
ERR_put_error(46, 123, 130, (__int64)"crypto/cms/cms_enc.c", 187);
}
return 0;
}