//
// ssl_handshake_hash from 0xd42f00 to 0xd42fd0 (208 bytes)
//
// 3 xrefs:
// > tls1_final_finish_mac @ 0xd613f4
// > tls1_generate_master_secret @ 0xd61770
// > ??> @ 0x329d0
//
// 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 ssl_handshake_hash(__int64 a1, __int64 a2, int a3)
{
__int64 v4; // x21
__int64 v5; // x0
__int64 v6; // x0
unsigned int v7; // w19
__int64 v8; // x0
__int64 v9; // x20
v4 = *(_QWORD *)(*(_QWORD *)(a1 + 144) + 224LL);
v5 = EVP_MD_CTX_md(v4);
v6 = EVP_MD_size(v5);
v7 = v6;
if ( (int)v6 > a3 || (v6 & 0x80000000) != 0 || (v8 = EVP_MD_CTX_new(v6), (v9 = v8) == 0) )
{
EVP_MD_CTX_free(0);
return 0;
}
else if ( (unsigned int)EVP_MD_CTX_copy_ex(v8, v4) )
{
if ( (int)EVP_DigestFinal_ex(v9, a2, 0) <= 0 )
v7 = 0;
EVP_MD_CTX_free(v9);
return v7;
}
else
{
EVP_MD_CTX_free(v9);
return 0;
}
}