//
// tls_construct_finished from 0x7a62c8 to 0x7a6408 (320 bytes)
//
// 3 xrefs:
// > ossl_statem_client_construct_message @ 0x7a43b0
// > ossl_statem_server_construct_message @ 0x7ace04
// > ??> @ 0x5d36c
//
// 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 tls_construct_finished(_DWORD *a1)
{
int v1; // r12
int v3; // r6
int v4; // r7
signed int v5; // r5
int v6; // r1
int v7; // r4
v1 = *(_DWORD *)(a1[1] + 100);
v3 = *(_DWORD *)(v1 + 56);
v4 = *(_DWORD *)(a1[22] + 4);
v5 = (*(int (**)(void))(v1 + 20))();
if ( v5 <= 0 )
return 0;
v6 = a1[26];
*(_DWORD *)(v6 + 384) = v5;
memcpy((void *)(v4 + v3), (const void *)(v6 + 256), v5);
if ( a1[7] )
{
if ( v5 > 64 )
OPENSSL_die("assertion failed: i <= EVP_MAX_MD_SIZE", "ssl/statem/statem_lib.c", 85);
memcpy((void *)(a1[26] + 765), (const void *)(a1[26] + 256), v5);
*(_BYTE *)(a1[26] + 829) = v5;
}
else
{
if ( v5 > 64 )
OPENSSL_die("assertion failed: i <= EVP_MAX_MD_SIZE", "ssl/statem/statem_lib.c", 81);
memcpy((void *)(a1[26] + 700), (const void *)(a1[26] + 256), v5);
*(_BYTE *)(a1[26] + 764) = v5;
}
v7 = (*(int (__fastcall **)(_DWORD *, int, signed int))(*(_DWORD *)(a1[1] + 100) + 60))(a1, 20, v5);
if ( v7 )
return 1;
ERR_put_error(20, 359, 68, "ssl/statem/statem_lib.c", 91);
return v7;
}