From d3085ab2b856692960b0574013c28f36f8883bdf Mon Sep 17 00:00:00 2001 From: irwir Date: Tue, 21 Apr 2020 22:26:05 +0300 Subject: [PATCH] Avoid re-assigning zero to `ret` variable. Resolve #3182. Signed-off-by: irwir --- library/ssl_tls.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index dbc5a3e88..ccfc4bdaa 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -2747,9 +2747,7 @@ int mbedtls_ssl_parse_certificate( mbedtls_ssl_context *ssl ) { ssl->session_negotiate->verify_result = MBEDTLS_X509_BADCERT_MISSING; - if( authmode == MBEDTLS_SSL_VERIFY_OPTIONAL ) - ret = 0; - else + if( authmode != MBEDTLS_SSL_VERIFY_OPTIONAL ) ret = MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE; goto exit;