//
// ssl3_get_req_cert_type from 0x9a33d4 to 0x9a34f4 (288 bytes)
//
// 2 xrefs:
// > tls_construct_certificate_request @ 0x9bf8f4
// > ??> @ 0x747fc
//
// 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:06:49 +0000
//
int __fastcall ssl3_get_req_cert_type(int *a1, _BYTE *a2)
{
int v2; // r3
const void *v3; // r5
int v7; // r3
int v8; // r3
int v9; // r1
char v10; // r2
int v11; // [sp+4h] [bp-4h] BYREF
v2 = a1[50];
v3 = *(const void **)(v2 + 160);
v11 = 0;
if ( v3 )
{
memcpy(a2, v3, *(_DWORD *)(v2 + 164));
return *(_DWORD *)(a1[50] + 164);
}
ssl_set_sig_mask(&v11, a1, 327694);
v7 = *(_DWORD *)(*(_DWORD *)(a1[26] + 528) + 12);
if ( *a1 > 768 )
{
v3 = (const void *)(*(_DWORD *)(*(_DWORD *)(a1[26] + 528) + 12) & 0x10);
if ( (v7 & 0x10) != 0 )
{
*a2 = 22;
a2[1] = -18;
a2[2] = -17;
return 3;
}
}
else if ( *a1 == 768 )
{
v3 = (const void *)(*(_DWORD *)(*(_DWORD *)(a1[26] + 528) + 12) & 2);
if ( (v7 & 2) != 0 )
{
v3 = &dword_0 + 2;
a2[1] = 6;
*a2 = 5;
v8 = 2;
v9 = 3;
goto LABEL_6;
}
}
v8 = (int)v3;
v9 = 1;
LABEL_6:
v10 = v11;
if ( (v11 & 1) == 0 )
{
v8 = v9;
*((_BYTE *)v3 + (_DWORD)a2) = 1;
}
if ( (v10 & 2) == 0 )
a2[v8++] = 2;
if ( *a1 <= 768 || (v10 & 8) != 0 )
return v8;
a2[v8] = 64;
return v8 + 1;
}