//
// tls_process_change_cipher_spec from 0x9bb024 to 0x9bb1a8 (388 bytes)
//
// 3 xrefs:
// > ossl_statem_client_process_message @ 0x9b8ed8
// > ossl_statem_server_process_message @ 0x9c1bbc
// > ??> @ 0x76dcc
//
// 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:01 +0000
//
int __fastcall tls_process_change_cipher_spec(_DWORD *a1, int a2)
{
int v3; // r2
int v4; // r2
int v6; // r3
v3 = *(_DWORD *)(a2 + 4);
if ( (*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 8) != 0 )
{
if ( *a1 == 256 )
{
if ( v3 != 2 )
goto LABEL_4;
}
else if ( v3 )
{
LABEL_4:
ERR_put_error(20, 363, 103, "ssl/statem/statem_lib.c", 146);
v4 = 47;
LABEL_5:
ssl3_send_alert(a1, 2, v4);
ossl_statem_set_error((int)a1);
return 0;
}
}
else if ( v3 )
{
ERR_put_error(20, 363, 103, "ssl/statem/statem_lib.c", 153);
v4 = 47;
goto LABEL_5;
}
v6 = a1[26];
if ( !*(_DWORD *)(v6 + 528) )
{
ERR_put_error(20, 363, 133, "ssl/statem/statem_lib.c", 161);
v4 = 10;
goto LABEL_5;
}
*(_DWORD *)(v6 + 220) = 1;
if ( !ssl3_do_change_cipher_spec(a1) )
{
ERR_put_error(20, 363, 68, "ssl/statem/statem_lib.c", 168);
v4 = 80;
goto LABEL_5;
}
if ( (*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 8) == 0 )
return 3;
dtls1_reset_seq_numbers((int)a1, 1);
if ( *a1 != 256 )
return 3;
++*(_WORD *)(a1[27] + 268);
return 3;
}