//
// ssl_parse_serverhello_renegotiate_ext from 0x7b5174 to 0x7b53a8 (564 bytes)
//
// 2 xrefs:
// > ssl_parse_serverhello_tlsext @ 0x7afbbc
// > ??> @ 0x5d86c
//
// 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 ssl_parse_serverhello_renegotiate_ext(int a1, unsigned __int8 **a2, _DWORD *a3)
{
int v3; // r6
unsigned int v6; // r2
_BOOL4 v7; // r3
_BOOL4 v8; // r4
unsigned __int8 *v9; // r12
int v10; // r4
unsigned __int8 *v12; // r0
unsigned __int8 *v13; // r1
unsigned int v14; // r3
unsigned int v15; // r8
unsigned __int8 *v16; // r9
unsigned int v17; // r3
v3 = *(_DWORD *)(a1 + 104);
v6 = *(unsigned __int8 *)(v3 + 764) + *(unsigned __int8 *)(v3 + 829);
if ( *(_BYTE *)(v3 + 764) )
v7 = 0;
else
v7 = v6 != 0;
if ( v7 )
OPENSSL_die("assertion failed: !expected_len || s->s3->previous_client_finished_len", "ssl/t1_reneg.c", 118);
if ( *(_BYTE *)(v3 + 829) )
v8 = 0;
else
v8 = v6 != 0;
if ( v8 )
OPENSSL_die("assertion failed: !expected_len || s->s3->previous_server_finished_len", "ssl/t1_reneg.c", 119);
v9 = a2[1];
if ( !v9 )
{
v10 = 0;
ERR_put_error(20, 301, 336, "ssl/t1_reneg.c", 124);
*a3 = 47;
return v10;
}
v12 = *a2 + 1;
v13 = (unsigned __int8 *)**a2;
*a2 = v12;
a2[1] = v9 - 1;
if ( v13 == v9 - 1 )
{
if ( (unsigned __int8 *)v6 == v13 )
{
v14 = *(unsigned __int8 *)(v3 + 764);
if ( v6 >= v14
&& (v15 = v6 - v14,
v16 = &v12[v14],
a2[1] = (unsigned __int8 *)(v6 - v14),
*a2 = &v12[v14],
!memcmp(v12, (const void *)(v3 + 700), *(unsigned __int8 *)(v3 + 764))) )
{
v17 = *(unsigned __int8 *)(v3 + 829);
if ( v17 <= v15 )
{
a2[1] = (unsigned __int8 *)(v15 - v17);
*a2 = &v16[v17];
if ( !memcmp(v16, (const void *)(v3 + 765), *(unsigned __int8 *)(v3 + 829)) )
{
*(_DWORD *)(v3 + 832) = 1;
return 1;
}
}
ERR_put_error(20, 301, 337, "ssl/t1_reneg.c", 158);
*a3 = 47;
return 0;
}
else
{
ERR_put_error(20, 301, 337, "ssl/t1_reneg.c", 149);
*a3 = 40;
return 0;
}
}
else
{
ERR_put_error(20, 301, 337, "ssl/t1_reneg.c", 140);
*a3 = 40;
return 0;
}
}
else
{
ERR_put_error(20, 301, 336, "ssl/t1_reneg.c", 132);
*a3 = 47;
return 0;
}
}