//
// sub_FD3648 from 0xfd3648 to 0xfd3848 (512 bytes)
//
// 1 xrefs:
// > tls1_set_sigalgs_list @ 0xfd9200
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:15:30 +0000
//
__int64 __fastcall sub_FD3648(void *a1, int a2, __int64 *a3)
{
__int64 v3; // x19
char *v5; // x0
char *v6; // x19
int v7; // w0
int v9; // w23
int v10; // w24
const char *v11; // x19
unsigned __int64 v12; // x0
_DWORD *v13; // x1
unsigned __int64 v14; // x2
__int64 v15; // x2
__int64 v16; // x3
char v17[24]; // [xsp+58h] [xbp+58h] BYREF
if ( !a1 )
return 0;
if ( a2 > 19 )
return 0;
if ( *a3 == 140 )
return 0;
v3 = a2;
memcpy(v17, a1, a2);
v17[v3] = 0;
v5 = strchr(v17, 43);
v6 = v5;
if ( !v5 )
return 0;
v7 = (unsigned __int8)v5[1];
*v6 = 0;
if ( !v7 )
return 0;
if ( !strcmp(v17, "RSA") )
{
v9 = 0;
v10 = 6;
}
else if ( !strcmp(v17, "DSA") )
{
v9 = 0;
v10 = 116;
}
else if ( !strcmp(v17, "ECDSA") )
{
v9 = 0;
v10 = 408;
}
else
{
v10 = 0;
v9 = OBJ_sn2nid(v17);
if ( !v9 )
v9 = OBJ_ln2nid(v17);
}
v11 = v6 + 1;
if ( !strcmp(v11, "RSA") )
{
v10 = 6;
goto LABEL_16;
}
if ( !strcmp(v11, "DSA") )
{
v10 = 116;
LABEL_16:
if ( v9 )
goto LABEL_17;
return 0;
}
if ( !strcmp(v11, "ECDSA") )
{
v10 = 408;
goto LABEL_16;
}
v9 = OBJ_sn2nid(v11);
if ( !v9 )
{
v9 = OBJ_ln2nid(v11);
if ( !v10 )
return 0;
goto LABEL_16;
}
if ( !v10 )
return 0;
LABEL_17:
v12 = *a3;
if ( *a3 )
{
v13 = a3 + 1;
v14 = 0;
while ( 1 )
{
v14 += 2LL;
if ( *v13 == v10 && v13[1] == v9 )
return 0;
v13 += 2;
if ( v14 >= v12 )
{
v15 = v12 + 1;
v16 = v12 + 2;
goto LABEL_27;
}
}
}
v16 = 2;
v15 = 1;
LABEL_27:
*((_DWORD *)a3 + v12 + 2) = v9;
*a3 = v16;
*((_DWORD *)a3 + v15 + 2) = v10;
return 1;
}