//
// ssl_replace_hash from 0x79a130 to 0x79a194 (100 bytes)
//
// 5 xrefs:
// > ssl3_change_cipher_state @ 0x7b80fc
// > ssl3_change_cipher_state @ 0x7b8200
// > tls1_change_cipher_state @ 0x7ba240
// > tls1_change_cipher_state @ 0x7ba500
// > ??> @ 0x5c47c
//
// 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 ssl_replace_hash(int *a1, int a2)
{
int v4; // r0
int v5; // r0
int v6; // r3
int v7; // r0
v4 = ssl_clear_hash_ctx(a1);
v5 = EVP_MD_CTX_new(v4);
v6 = v5;
*a1 = v5;
if ( !v5 || a2 && (v7 = EVP_DigestInit_ex(v5, a2, 0), v6 = *a1, v7 <= 0) )
{
EVP_MD_CTX_free(v6);
v6 = 0;
*a1 = 0;
}
return v6;
}