//
// sub_7ADE4C from 0x7ade4c to 0x7adffc (432 bytes)
//
// 3 xrefs:
// > tls12_check_peer_sigalg @ 0x7b0c00
// > tls1_check_chain @ 0x7b4500
// > tls1_check_chain @ 0x7b4754
//
// 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 sub_7ADE4C(_DWORD *a1, unsigned __int8 *a2, unsigned __int8 *a3)
{
int v4; // r3
unsigned __int8 *v5; // r2
int v6; // r12
int v7; // r4
int v8; // r3
int v9; // t1
int v11; // r12
int v12; // r5
char *v13; // r3
unsigned int v14; // r2
int v15; // lr
char *v16; // r3
int v17; // r2
int v18; // r3
unsigned int v19; // r2
if ( a3 )
{
v4 = a1[60];
v5 = *(unsigned __int8 **)(v4 + 204);
if ( v5 )
{
v6 = *(_DWORD *)(v4 + 200);
if ( !v6 )
return 0;
v7 = *a3;
if ( *v5 != v7 )
{
v8 = 0;
while ( ++v8 != v6 )
{
v9 = *++v5;
if ( v9 == v7 )
goto LABEL_9;
}
return 0;
}
}
}
LABEL_9:
if ( !a2 )
return 1;
v11 = *(_DWORD *)(a1[50] + 16) & 0x30000;
v12 = 0;
switch ( v11 )
{
case 131072:
v13 = (char *)&unk_A0CB4A;
v14 = 2;
LABEL_30:
v15 = v14 >> 1;
if ( v14 >> 1 )
goto LABEL_17;
return 0;
case 196608:
v13 = (char *)&unk_A0CB48;
v14 = 4;
goto LABEL_30;
case 65536:
v13 = (char *)&unk_A0CB48;
v14 = 2;
goto LABEL_30;
}
v13 = (char *)a1[105];
v14 = a1[104];
if ( !v13 )
{
v13 = (char *)&unk_A0CB40;
v15 = 4;
LABEL_17:
while ( 1 )
{
v16 = v13 + 2;
v17 = 0;
while ( (unsigned __int8)*(v16 - 2) != *a2 || (unsigned __int8)*(v16 - 1) != a2[1] )
{
++v17;
v16 += 2;
if ( v17 == v15 )
return 0;
}
if ( v17 == v15 )
return 0;
if ( a1[7] && v12 != 1 )
{
v18 = a1[60];
v12 = 1;
v19 = *(_DWORD *)(v18 + 208);
v13 = *(char **)(v18 + 212);
if ( (v19 & 1) != 0 )
goto LABEL_28;
v15 = v19 >> 1;
if ( v19 >> 1 )
continue;
}
return 1;
}
}
if ( (v14 & 1) == 0 )
goto LABEL_30;
LABEL_28:
ERR_put_error(20, 338, 68, "ssl/t1_lib.c", 291);
return 0;
}