//
// tls1_set_curves from 0xfd4070 to 0xfd41a4 (308 bytes)
//
// 6 xrefs:
// > ssl3_ctrl @ 0xfb70a8
// > ssl3_ctrl @ 0xfb7248
// > ssl3_ctx_ctrl @ 0xfb74bc
// > ssl3_ctx_ctrl @ 0xfb78c0
// > tls1_set_curves_list @ 0xfd41f8
// > ??> @ 0x87b98
//
// 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:31 +0000
//
__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;
}