Refactor ssl_{server2,client2} for NamedGroup IDs

Signed-off-by: Brett Warren <brett.warren@arm.com>
This commit is contained in:
Brett Warren 2021-08-17 09:32:04 +01:00
parent 01f3dae3f3
commit 25386b7652
2 changed files with 10 additions and 10 deletions

View file

@ -678,7 +678,7 @@ int main( int argc, char *argv[] )
#endif
#if defined(MBEDTLS_ECP_C)
mbedtls_ecp_group_id curve_list[CURVE_LIST_SIZE];
uint16_t group_list[CURVE_LIST_SIZE];
const mbedtls_ecp_curve_info *curve_cur;
#endif
#if defined(MBEDTLS_SSL_DTLS_SRTP)
@ -1452,7 +1452,7 @@ int main( int argc, char *argv[] )
if( strcmp( p, "none" ) == 0 )
{
curve_list[0] = MBEDTLS_ECP_DP_NONE;
group_list[0] = 0;
}
else if( strcmp( p, "default" ) != 0 )
{
@ -1469,7 +1469,7 @@ int main( int argc, char *argv[] )
if( ( curve_cur = mbedtls_ecp_curve_info_from_name( q ) ) != NULL )
{
curve_list[i++] = curve_cur->grp_id;
group_list[i++] = curve_cur->tls_id;
}
else
{
@ -1495,7 +1495,7 @@ int main( int argc, char *argv[] )
goto exit;
}
curve_list[i] = MBEDTLS_ECP_DP_NONE;
group_list[i] = 0;
}
}
#endif /* MBEDTLS_ECP_C */
@ -1889,7 +1889,7 @@ int main( int argc, char *argv[] )
if( opt.curves != NULL &&
strcmp( opt.curves, "default" ) != 0 )
{
mbedtls_ssl_conf_curves( &conf, curve_list );
mbedtls_ssl_conf_groups( &conf, group_list );
}
#endif

View file

@ -1326,7 +1326,7 @@ int main( int argc, char *argv[] )
sni_entry *sni_info = NULL;
#endif
#if defined(MBEDTLS_ECP_C)
mbedtls_ecp_group_id curve_list[CURVE_LIST_SIZE];
uint16_t group_list[CURVE_LIST_SIZE];
const mbedtls_ecp_curve_info * curve_cur;
#endif
#if defined(MBEDTLS_SSL_ALPN)
@ -2177,7 +2177,7 @@ int main( int argc, char *argv[] )
if( strcmp( p, "none" ) == 0 )
{
curve_list[0] = MBEDTLS_ECP_DP_NONE;
group_list[0] = 0;
}
else if( strcmp( p, "default" ) != 0 )
{
@ -2194,7 +2194,7 @@ int main( int argc, char *argv[] )
if( ( curve_cur = mbedtls_ecp_curve_info_from_name( q ) ) != NULL )
{
curve_list[i++] = curve_cur->grp_id;
group_list[i++] = curve_cur->tls_id;
}
else
{
@ -2220,7 +2220,7 @@ int main( int argc, char *argv[] )
goto exit;
}
curve_list[i] = MBEDTLS_ECP_DP_NONE;
group_list[i] = 0;
}
}
#endif /* MBEDTLS_ECP_C */
@ -2857,7 +2857,7 @@ int main( int argc, char *argv[] )
if( opt.curves != NULL &&
strcmp( opt.curves, "default" ) != 0 )
{
mbedtls_ssl_conf_curves( &conf, curve_list );
mbedtls_ssl_conf_groups( &conf, group_list );
}
#endif