//
// tls_process_finished from 0x9bb1bc to 0x9bb334 (376 bytes)
//
// 3 xrefs:
// > ossl_statem_client_process_message @ 0x9b8eb4
// > ossl_statem_server_process_message @ 0x9c1ba4
// > ??> @ 0x76dbc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:01 +0000
//
int __fastcall tls_process_finished(_DWORD *a1, _DWORD *a2)
{
int v2; // r3
signed int v4; // r5
int v5; // r2
v2 = a1[26];
if ( !*(_DWORD *)(v2 + 220) )
{
ERR_put_error(20, 364, 154, "ssl/statem/statem_lib.c", 202);
v5 = 10;
goto LABEL_4;
}
*(_DWORD *)(v2 + 220) = 0;
v4 = *(_DWORD *)(v2 + 516);
if ( v4 != a2[1] )
{
ERR_put_error(20, 364, 111, "ssl/statem/statem_lib.c", 211);
v5 = 50;
LABEL_4:
ssl3_send_alert(a1, 2, v5);
ossl_statem_set_error((int)a1);
return 0;
}
if ( CRYPTO_memcmp(*a2, v2 + 388, *(_DWORD *)(v2 + 516)) )
{
ERR_put_error(20, 364, 149, "ssl/statem/statem_lib.c", 217);
v5 = 51;
goto LABEL_4;
}
if ( a1[7] )
{
if ( v4 > 64 )
OPENSSL_die("assertion failed: i <= EVP_MAX_MD_SIZE", "ssl/statem/statem_lib.c", 225);
memcpy((void *)(a1[26] + 700), (const void *)(a1[26] + 388), v4);
*(_BYTE *)(a1[26] + 764) = v4;
return 1;
}
else
{
if ( v4 > 64 )
OPENSSL_die("assertion failed: i <= EVP_MAX_MD_SIZE", "ssl/statem/statem_lib.c", 229);
memcpy((void *)(a1[26] + 765), (const void *)(a1[26] + 388), v4);
*(_BYTE *)(a1[26] + 829) = v4;
return 1;
}
}