//
// tls_process_finished from 0xd4e52c to 0xd4e694 (360 bytes)
//
// 3 xrefs:
// > ossl_statem_client_process_message @ 0xd4c2d0
// > ossl_statem_server_process_message @ 0xd54634
// > ??> @ 0xb5d70
//
// 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 tls_process_finished(__int64 a1, _QWORD *a2)
{
__int64 v2; // x3
int v4; // w21
__int64 v5; // x0
unsigned int v6; // w2
v2 = *(_QWORD *)(a1 + 144);
if ( !*(_DWORD *)(v2 + 232) )
{
ERR_put_error(20, 364, 154, "ssl/statem/statem_lib.c", 202);
v6 = 10;
goto LABEL_4;
}
v4 = *(_DWORD *)(v2 + 532);
v5 = a2[1];
*(_DWORD *)(v2 + 232) = 0;
if ( v4 != v5 )
{
ERR_put_error(20, 364, 111, "ssl/statem/statem_lib.c", 211);
v6 = 50;
LABEL_4:
ssl3_send_alert(a1, 2, v6);
ossl_statem_set_error(a1);
return 0;
}
if ( (unsigned int)CRYPTO_memcmp(*a2, v2 + 404, v4) )
{
ERR_put_error(20, 364, 149, "ssl/statem/statem_lib.c", 217);
v6 = 51;
goto LABEL_4;
}
if ( *(_DWORD *)(a1 + 56) )
{
if ( v4 > 64 )
OPENSSL_die((int)"assertion failed: i <= EVP_MAX_MD_SIZE");
memcpy((void *)(*(_QWORD *)(a1 + 144) + 832LL), (const void *)(*(_QWORD *)(a1 + 144) + 404LL), v4);
*(_BYTE *)(*(_QWORD *)(a1 + 144) + 896LL) = v4;
return 1;
}
else
{
if ( v4 > 64 )
OPENSSL_die((int)"assertion failed: i <= EVP_MAX_MD_SIZE");
memcpy((void *)(*(_QWORD *)(a1 + 144) + 897LL), (const void *)(*(_QWORD *)(a1 + 144) + 404LL), v4);
*(_BYTE *)(*(_QWORD *)(a1 + 144) + 961LL) = v4;
return 1;
}
}