//
// dtls_construct_change_cipher_spec from 0x7a5524 to 0x7a55fc (216 bytes)
//
// 3 xrefs:
// > ossl_statem_client_construct_message @ 0x7a43d8
// > ossl_statem_server_construct_message @ 0x7ace40
// > ??> @ 0x5d37c
//
// 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 dtls_construct_change_cipher_spec(_DWORD *a1)
{
_BYTE *v1; // lr
int v2; // r3
__int16 v3; // r12
bool v4; // zf
int v5; // r5
v1 = *(_BYTE **)(a1[22] + 4);
*v1 = 1;
v2 = a1[27];
v3 = *(_WORD *)(v2 + 266);
v4 = *a1 == 256;
*(_WORD *)(v2 + 264) = v3;
a1[24] = 1;
if ( v4 )
{
*(_WORD *)(v2 + 266) = v3 + 1;
v1[1] = HIBYTE(v3);
v1[2] = *(_WORD *)(a1[27] + 264);
v2 = a1[27];
v3 = *(_WORD *)(v2 + 264);
a1[24] += 2;
}
a1[25] = 0;
*(_DWORD *)(v2 + 292) = 0;
*(_BYTE *)(v2 + 288) = 1;
*(_WORD *)(v2 + 296) = v3;
*(_DWORD *)(v2 + 300) = 0;
*(_DWORD *)(v2 + 304) = 0;
v5 = dtls1_buffer_message(a1, 1);
if ( v5 )
return 1;
ERR_put_error(20, 371, 68, "ssl/statem/statem_dtls.c", 897);
return v5;
}