//
// ssl_parse_serverhello_renegotiate_ext from 0x9c9d78 to 0x9c9fac (564 bytes)
//
// 2 xrefs:
// > ssl_parse_serverhello_tlsext @ 0x9c47c0
// > ??> @ 0x772ec
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:08 +0000
//
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;
}
}