//
// CMS_RecipientInfo_kari_set0_pkey from 0x109d394 to 0x109d414 (128 bytes)
//
// 1 xrefs:
// > ??> @ 0x91c90
//
// 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:29 +0000
//
__int64 __fastcall CMS_RecipientInfo_kari_set0_pkey(__int64 a1, __int64 a2)
{
__int64 v2; // x19
__int64 *v3; // x0
__int64 v4; // x20
v2 = *(_QWORD *)(a1 + 8);
EVP_PKEY_CTX_free(*(_QWORD *)(v2 + 40));
*(_QWORD *)(v2 + 40) = 0;
if ( !a2 )
return 1;
v3 = (__int64 *)EVP_PKEY_CTX_new(a2, 0);
v4 = (__int64)v3;
if ( v3 && (unsigned int)EVP_PKEY_derive_init(v3) )
{
*(_QWORD *)(v2 + 40) = v4;
return 1;
}
else
{
EVP_PKEY_CTX_free(v4);
return 0;
}
}