//
// ssl3_final_finish_mac from 0xfdd960 to 0xfddb04 (420 bytes)
//
// 2 xrefs:
// > ??> @ 0x579d0
// > ??> @ 0x15382a0
//
// 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:15:36 +0000
//
__int64 __fastcall ssl3_final_finish_mac(__int64 a1, __int64 a2, int a3, __int64 a4)
{
unsigned int v8; // w19
__int64 v10; // x0
__int64 v11; // x0
__int64 v12; // x0
__int64 v13; // x24
__int64 v14; // x0
v8 = ssl3_digest_cached_records(a1, 0);
if ( !v8 )
return v8;
v10 = EVP_MD_CTX_md(*(_QWORD *)(*(_QWORD *)(a1 + 144) + 224LL));
v11 = EVP_MD_type(v10);
if ( (_DWORD)v11 == 114 )
{
v12 = EVP_MD_CTX_new(v11);
v13 = v12;
if ( v12 )
{
v8 = EVP_MD_CTX_copy_ex(v12, *(_QWORD *)(*(_QWORD *)(a1 + 144) + 224LL));
if ( v8 )
{
v14 = EVP_MD_CTX_md(v13);
v8 = EVP_MD_size(v14);
if ( (v8 & 0x80000000) != 0 )
{
v8 = 0;
EVP_MD_CTX_reset(v13);
}
else
{
if ( a2 && (int)EVP_DigestUpdate(v13, a2, a3) <= 0
|| (int)EVP_MD_CTX_ctrl(
v13,
29,
*(unsigned int *)(*(_QWORD *)(a1 + 376) + 4LL),
*(_QWORD *)(a1 + 376) + 8LL) <= 0
|| (int)EVP_DigestFinal_ex(v13, a4, 0) <= 0 )
{
v8 = 0;
ERR_put_error(20, 285, 68, "ssl/s3_enc.c", 437);
}
EVP_MD_CTX_free(v13);
}
}
else
{
ERR_put_error(20, 285, 68, "ssl/s3_enc.c", 422);
}
}
else
{
v8 = 0;
ERR_put_error(20, 285, 65, "ssl/s3_enc.c", 418);
}
return v8;
}
ERR_put_error(20, 285, 324, "ssl/s3_enc.c", 412);
return 0;
}