From f595c5b69a0e9fd90abaf5446e9f653c6d265eda Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Fri, 16 Jun 2023 14:31:27 +0200 Subject: [PATCH] Use valid guard for filling group list with EC groups Signed-off-by: Przemek Stekiel --- library/ssl_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/ssl_client.c b/library/ssl_client.c index 2a2efe1df..8ee06eba2 100644 --- a/library/ssl_client.c +++ b/library/ssl_client.c @@ -258,7 +258,8 @@ static int ssl_write_supported_groups_ext(mbedtls_ssl_context *ssl, for (; *group_list != 0; group_list++) { MBEDTLS_SSL_DEBUG_MSG(1, ("got supported group(%04x)", *group_list)); -#if defined(PSA_WANT_ALG_ECDH) +#if defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_ECDSA_C) || \ + defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) if ((mbedtls_ssl_conf_is_tls13_enabled(ssl->conf) && mbedtls_ssl_tls13_named_group_is_ecdhe(*group_list)) || (mbedtls_ssl_conf_is_tls12_enabled(ssl->conf) && @@ -274,7 +275,7 @@ static int ssl_write_supported_groups_ext(mbedtls_ssl_context *ssl, mbedtls_ssl_get_curve_name_from_tls_id(*group_list), *group_list)); } -#endif /* PSA_WANT_ALG_ECDH */ +#endif /* MBEDTLS_ECDH_C || MBEDTLS_ECDSA_C || MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */ #if defined(PSA_WANT_ALG_FFDH) if ((mbedtls_ssl_conf_is_tls13_enabled(ssl->conf) && mbedtls_ssl_tls13_named_group_is_dhe(*group_list))) {