Remove ecp_c undefine routines
@@ -120,13 +120,12 @@ static int ssl_tls13_write_named_group_list_ecdhe( mbedtls_ssl_context *ssl,
size_t *olen )
{
unsigned char *p = buf;
-#if !defined(MBEDTLS_ECP_C)
- ((void) ssl);
-#endif
*olen = 0;
-#if defined(MBEDTLS_ECP_C)
+ if( ssl->conf->curve_list == NULL )
+ return( MBEDTLS_ERR_SSL_BAD_CONFIG );
+
for ( const mbedtls_ecp_group_id *grp_id = ssl->conf->curve_list;
*grp_id != MBEDTLS_ECP_DP_NONE;
grp_id++ )
@@ -135,12 +134,7 @@ static int ssl_tls13_write_named_group_list_ecdhe( mbedtls_ssl_context *ssl,
info = mbedtls_ecp_curve_info_from_grp_id( *grp_id );
if( info == NULL )
continue;
-#else
- for ( const mbedtls_ecp_curve_info *info = mbedtls_ecp_curve_list();
- info->grp_id != MBEDTLS_ECP_DP_NONE;
- info++ )
- {
-#endif
+
if( !mbedtls_ssl_tls13_named_group_is_ecdhe( info->tls_id ) )
continue;
