//
// tls1_set_curves from 0xd55d1c to 0xd55e50 (308 bytes)
//
// 6 xrefs:
// > ssl3_ctrl @ 0xd38d54
// > ssl3_ctrl @ 0xd38ef4
// > ssl3_ctx_ctrl @ 0xd39168
// > ssl3_ctx_ctrl @ 0xd3956c
// > tls1_set_curves_list @ 0xd55ea4
// > ??> @ 0x63b28
//
// 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
//
__int64 __fastcall tls1_set_curves(__int64 *a1, __int64 *a2, __int64 a3, __int64 a4)
{
__int64 v5; // x27
__int64 result; // x0
__int64 v10; // x25
__int64 v11; // x21
__int64 v12; // x20
__int64 v13; // x19
bool v14; // zf
int v15; // w0
int v16; // w0
__int64 v17; // x4
v5 = 2 * a4;
result = CRYPTO_malloc(2 * a4, "ssl/t1_lib.c", 436);
v10 = result;
if ( result )
{
if ( a4 )
{
v11 = 0;
v12 = result;
v13 = 0;
while ( 1 )
{
v15 = *(_DWORD *)(a3 + 4 * v13++);
v16 = tls1_ec_nid2curve_id(v15);
v17 = 1LL << v16;
if ( !v16 )
break;
v14 = (v17 & v11) == 0;
v11 |= v17;
if ( !v14 )
break;
*(_BYTE *)(v12 + 1) = v16;
v12 += 2;
*(_BYTE *)(v12 - 2) = BYTE1(v16);
if ( v13 == a4 )
goto LABEL_9;
}
CRYPTO_free(v10, "ssl/t1_lib.c", 445);
return 0;
}
else
{
LABEL_9:
CRYPTO_free(*a1, "ssl/t1_lib.c", 451);
*a1 = v10;
*a2 = v5;
return 1;
}
}
return result;
}