//
// tls_construct_finished from 0xd4e254 to 0xd4e3c8 (372 bytes)
//
// 3 xrefs:
// > ossl_statem_client_construct_message @ 0xd4c3f4
// > ossl_statem_server_construct_message @ 0xd544c0
// > ??> @ 0x82b48
//
// 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_construct_finished(__int64 a1)
{
__int64 v1; // x4
__int64 v2; // x22
unsigned int v4; // w23
int v5; // w0
int v6; // w20
__int64 v7; // x3
size_t v8; // x21
v1 = *(_QWORD *)(*(_QWORD *)(a1 + 8) + 192LL);
v2 = *(_QWORD *)(*(_QWORD *)(a1 + 120) + 8LL);
v4 = *(_DWORD *)(v1 + 108);
v5 = (*(__int64 (**)(void))(v1 + 40))();
v6 = v5;
if ( v5 <= 0 )
return 0;
v7 = *(_QWORD *)(a1 + 144);
v8 = v5;
*(_DWORD *)(v7 + 400) = v5;
memcpy((void *)(v2 + v4), (const void *)(v7 + 272), v5);
if ( *(_DWORD *)(a1 + 56) )
{
if ( v6 > 64 )
OPENSSL_die((int)"assertion failed: i <= EVP_MAX_MD_SIZE");
memcpy((void *)(*(_QWORD *)(a1 + 144) + 897LL), (const void *)(*(_QWORD *)(a1 + 144) + 272LL), v8);
*(_BYTE *)(*(_QWORD *)(a1 + 144) + 961LL) = v6;
}
else
{
if ( v6 > 64 )
OPENSSL_die((int)"assertion failed: i <= EVP_MAX_MD_SIZE");
memcpy((void *)(*(_QWORD *)(a1 + 144) + 832LL), (const void *)(*(_QWORD *)(a1 + 144) + 272LL), v8);
*(_BYTE *)(*(_QWORD *)(a1 + 144) + 896LL) = v6;
}
if ( (*(unsigned int (__fastcall **)(__int64, __int64, size_t))(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 192LL) + 112LL))(
a1,
20,
v8) )
{
return 1;
}
ERR_put_error(20, 359, 68, "ssl/statem/statem_lib.c", 91);
return 0;
}