//
// tls_client_key_exchange_post_work from 0xfc8fb0 to 0xfc90c8 (280 bytes)
//
// 2 xrefs:
// > ossl_statem_client_post_work @ 0xfc91b4
// > ??> @ 0xdd590
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:15:25 +0000
//
__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;
}