//
// CMS_RecipientInfo_kari_set0_pkey from 0xe1f094 to 0xe1f114 (128 bytes)
//
// 1 xrefs:
// > ??> @ 0x6be68
//
// 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_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;
}
}