From dbb6f08c3fe57e84a17c72ac13ad05514dd7c926 Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Wed, 2 Nov 2022 15:33:31 +0000 Subject: [PATCH] Eliminate bad_params variable Signed-off-by: David Horstmann --- library/ssl_cli.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 4817bd6413..41ea83fa15 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -2694,17 +2694,14 @@ static int ssl_check_server_ecdh_params( const mbedtls_ssl_context *ssl ) MBEDTLS_SSL_DEBUG_MSG( 2, ( "ECDH curve: %s", curve_info->name ) ); - int bad_params = 0; #if defined(MBEDTLS_ECP_C) if( mbedtls_ssl_check_curve( ssl, grp_id ) != 0 ) - bad_params = 1; + return( -1 ); #else if( ssl->handshake->ecdh_ctx.grp.nbits < 163 || ssl->handshake->ecdh_ctx.grp.nbits > 521 ) - bad_params = 1; -#endif - if( bad_params ) return( -1 ); +#endif MBEDTLS_SSL_DEBUG_ECDH( 3, &ssl->handshake->ecdh_ctx, MBEDTLS_DEBUG_ECDH_QP );