//
// sub_7BA004 from 0x7ba004 to 0x7ba1c8 (452 bytes)
//
// 3 xrefs:
// > tls1_setup_key_block @ 0x7ba9e4
// > tls1_generate_master_secret @ 0x7baed4
// > tls1_export_keying_material @ 0x7bb19c
//
// 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
//
bool __fastcall sub_7BA004(
int a1,
int a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8,
int a9,
int a10,
int a11,
int a12,
int a13)
{
int v16; // r4
int v17; // r5
_BOOL4 v18; // r4
int v20; // [sp+Ch] [bp-8h] BYREF
v20 = a13;
v16 = ssl_prf_md(a1);
if ( v16 )
{
v17 = EVP_PKEY_CTX_new_id(1021, 0);
v18 = v17
&& EVP_PKEY_derive_init() > 0
&& EVP_PKEY_CTX_ctrl(v17, -1, 1024, 4096, 0, v16) > 0
&& EVP_PKEY_CTX_ctrl(v17, -1, 1024, 4097, a11, a10) > 0
&& EVP_PKEY_CTX_ctrl(v17, -1, 1024, 4098, a3, a2) > 0
&& EVP_PKEY_CTX_ctrl(v17, -1, 1024, 4098, a5, a4) > 0
&& EVP_PKEY_CTX_ctrl(v17, -1, 1024, 4098, a7, a6) > 0
&& EVP_PKEY_CTX_ctrl(v17, -1, 1024, 4098, a9, a8) > 0
&& EVP_PKEY_CTX_ctrl(v17, -1, 1024, 4098, 0, 0) > 0
&& EVP_PKEY_derive(v17, a12, &v20) > 0;
EVP_PKEY_CTX_free(v17);
return v18;
}
else
{
ERR_put_error(20, 284, 68, "ssl/t1_enc.c", 62);
return 0;
}
}