//
// EVP_PKEY_copy_parameters from 0x102a510 to 0x102a638 (296 bytes)
//
// 13 xrefs:
// > sub_E2DA90 @ 0xe2e794
// > sub_FC2264 @ 0xfc22c4
// > sub_FC23F8 @ 0xfc2444
// > SSL_use_PrivateKey @ 0xfc2c20
// > SSL_CTX_use_PrivateKey @ 0xfc3510
// > tls_process_client_key_exchange @ 0xfd1224
// > tls_process_client_key_exchange @ 0xfd1424
// > X509_get_pubkey_parameters @ 0x106a048
// > X509_get_pubkey_parameters @ 0x106a060
// > sub_10A8664 @ 0x10a86a4
// > sub_10AA220 @ 0x10aa25c
// > sub_10B2CA4 @ 0x10b2cf0
// > ??> @ 0x58750
//
// 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:16:16 +0000
//
__int64 __fastcall EVP_PKEY_copy_parameters(_DWORD *a1, __int64 a2)
{
__int64 v4; // x0
__int64 (__fastcall *v5)(_DWORD *, __int64); // x2
__int64 result; // x0
if ( !*a1 )
{
if ( !(unsigned int)EVP_PKEY_set_type((__int64)a1, *(_DWORD *)a2) )
return 0;
if ( !(unsigned int)EVP_PKEY_missing_parameters(a2) )
goto LABEL_4;
LABEL_10:
ERR_put_error(6, 103, 103, (__int64)"crypto/evp/p_lib.c", 84);
return 0;
}
if ( *a1 != *(_DWORD *)a2 )
{
ERR_put_error(6, 103, 101, (__int64)"crypto/evp/p_lib.c", 79);
return 0;
}
if ( (unsigned int)EVP_PKEY_missing_parameters(a2) )
goto LABEL_10;
LABEL_4:
if ( (unsigned int)EVP_PKEY_missing_parameters((__int64)a1) )
{
v4 = *(_QWORD *)(a2 + 16);
if ( v4 )
{
v5 = *(__int64 (__fastcall **)(_DWORD *, __int64))(v4 + 136);
if ( v5 )
return v5(a1, a2);
}
return 0;
}
result = EVP_PKEY_cmp_parameters((__int64)a1, (_DWORD *)a2);
if ( (_DWORD)result != 1 )
{
ERR_put_error(6, 103, 153, (__int64)"crypto/evp/p_lib.c", 91);
return 0;
}
return result;
}