//
// CMS_RecipientInfo_kari_set0_pkey from 0x8747ec to 0x874850 (100 bytes)
//
// 1 xrefs:
// > ??> @ 0x6a38c
//
// 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
//
int __fastcall CMS_RecipientInfo_kari_set0_pkey(int a1, int a2)
{
int v2; // r4
int *v4; // r0
int v5; // r5
v2 = *(_DWORD *)(a1 + 4);
EVP_PKEY_CTX_free(*(_DWORD *)(v2 + 20));
*(_DWORD *)(v2 + 20) = 0;
if ( !a2 )
return 1;
v4 = (int *)EVP_PKEY_CTX_new(a2, nullptr);
v5 = (int)v4;
if ( v4 && EVP_PKEY_derive_init(v4) )
{
*(_DWORD *)(v2 + 20) = v5;
return 1;
}
else
{
EVP_PKEY_CTX_free(v5);
return 0;
}
}