//
// tls_client_key_exchange_post_work from 0xd4ac5c to 0xd4ad74 (280 bytes)
//
// 2 xrefs:
// > ossl_statem_client_post_work @ 0xd4ae60
// > ??> @ 0xa8c90
//
// 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_client_key_exchange_post_work(__int64 a1)
{
__int64 v1; // x2
__int64 v3; // x20
__int64 v4; // x21
int v5; // w1
v1 = *(_QWORD *)(a1 + 144);
v3 = *(_QWORD *)(v1 + 672);
v4 = *(_QWORD *)(v1 + 680);
v5 = *(_DWORD *)(*(_QWORD *)(v1 + 552) + 20LL);
if ( (v5 & 0x20) != 0 )
{
if ( !(unsigned int)srp_generate_client_master_secret() )
{
ERR_put_error(20, 354, 68, "ssl/statem/statem_clnt.c", 2559);
goto LABEL_6;
}
return 1;
}
if ( !v3 && (v5 & 8) == 0 )
{
ssl3_send_alert(a1, 2, 0x50u);
ERR_put_error(20, 354, 65, "ssl/statem/statem_clnt.c", 2568);
goto LABEL_6;
}
if ( ssl_generate_master_secret(a1, *(const void **)(v1 + 672), *(_QWORD *)(v1 + 680), 1) )
return 1;
v4 = 0;
ssl3_send_alert(a1, 2, 0x50u);
v3 = 0;
ERR_put_error(20, 354, 68, "ssl/statem/statem_clnt.c", 2573);
LABEL_6:
CRYPTO_clear_free(v3, v4, "ssl/statem/statem_clnt.c", 2606);
*(_QWORD *)(*(_QWORD *)(a1 + 144) + 672LL) = 0;
return 0;
}