From ff229cf639c28b0f1af66bb5b1353bddd32d2e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 7 Feb 2022 12:00:32 +0100 Subject: [PATCH] Add debug message for wrong curve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The non-PSA path has a debug message here, so let's have a similar one in the PSA case - just add the curve ID to be a bit more informative. Signed-off-by: Manuel Pégourié-Gonnard --- library/ssl_cli.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 75f225652..1a5a25f9b 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -2385,7 +2385,12 @@ static int ssl_parse_server_ecdh_params_psa( mbedtls_ssl_context *ssl, /* Check it's a curve we offered */ if( mbedtls_ssl_check_curve_tls_id( ssl, tls_id ) != 0 ) + { + MBEDTLS_SSL_DEBUG_MSG( 2, + ( "bad server key exchange message (ECDHE curve): %u", + (unsigned) tls_id ) ); return( MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE ); + } /* Convert EC group to PSA key type. */ if( ( handshake->ecdh_psa_type =