//
// ssl_replace_hash from 0xd42c04 to 0xd42c6c (104 bytes)
//
// 5 xrefs:
// > ssl3_change_cipher_state @ 0xd5ec58
// > ssl3_change_cipher_state @ 0xd5ed64
// > tls1_change_cipher_state @ 0xd60be8
// > tls1_change_cipher_state @ 0xd60e64
// > ??> @ 0x88878
//
// 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_replace_hash(__int64 *a1, __int64 a2)
{
__int64 v3; // x0
__int64 v4; // x0
__int64 v5; // x2
int v6; // w0
v3 = ssl_clear_hash_ctx(a1);
v4 = EVP_MD_CTX_new(v3);
*a1 = v4;
v5 = v4;
if ( !v4 || a2 && (v6 = EVP_DigestInit_ex(v4, a2, 0), v5 = *a1, v6 <= 0) )
{
EVP_MD_CTX_free(v5);
*a1 = 0;
return 0;
}
return v5;
}