//
// cms_env_asn1_ctrl from 0x109baa8 to 0x109bb8c (228 bytes)
//
// 6 xrefs:
// > CMS_RecipientInfo_decrypt @ 0x109c2ac
// > CMS_RecipientInfo_encrypt @ 0x109c7a4
// > CMS_add1_recipient_cert @ 0x109ce08
// > CMS_RecipientInfo_kari_decrypt @ 0x109d46c
// > cms_RecipientInfo_kari_encrypt @ 0x109d8fc
// > ??> @ 0xf06a0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:17:28 +0000
//
__int64 __fastcall cms_env_asn1_ctrl(int *a1)
{
int v2; // w0
__int64 v3; // x0
__int64 v4; // x4
__int64 (*v5)(void); // x4
int v6; // w0
__int64 v8; // x0
v2 = *a1;
if ( v2 )
{
if ( v2 != 1 )
return 0;
v8 = *(_QWORD *)(*((_QWORD *)a1 + 1) + 40LL);
if ( !v8 )
return 0;
v3 = EVP_PKEY_CTX_get0_pkey(v8);
if ( !v3 )
return 0;
}
else
{
v3 = *(_QWORD *)(*((_QWORD *)a1 + 1) + 40LL);
}
v4 = *(_QWORD *)(v3 + 16);
if ( v4 )
{
v5 = *(__int64 (**)(void))(v4 + 176);
if ( v5 )
{
v6 = v5();
if ( v6 == -2 )
{
ERR_put_error(46, 171, 125, (__int64)"crypto/cms/cms_env.c", 71);
return 0;
}
if ( v6 <= 0 )
{
ERR_put_error(46, 171, 111, (__int64)"crypto/cms/cms_env.c", 75);
return 0;
}
}
}
return 1;
}