From 4491a791becbbbd16d1552794e3f9196bfbd2c3f Mon Sep 17 00:00:00 2001 From: Ron Eldor Date: Tue, 3 Oct 2017 15:58:26 +0300 Subject: [PATCH] Parse Signature Algorithm ext when renegotiating Signature algorithm extension was skipped when renegotiation was in progress, causing the signature algorithm not to be known when renegotiating, and failing the handshake. Fix removes the renegotiation step check before parsing the extension. --- ChangeLog | 3 +++ library/ssl_srv.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e431d8de2..9e025daec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ Bugfix * Fix usage help in ssl_server2 example. Found and fixed by Bei Lin. * Fix Visual Studio implicit cast compilation warnings in the net.c and x509.c modules and some sample applications. + * Parse signature algorithm extension when renegotiating. Previously, + renegotiated handshakes would only accept signatures using SHA-1 + regardless of the peer's preferences, or fail if SHA-1 was disabled. = mbed TLS 1.3.21 branch released 2017-08-10 diff --git a/library/ssl_srv.c b/library/ssl_srv.c index 146f28310..0f0369aa4 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -1675,10 +1675,6 @@ static int ssl_parse_client_hello( ssl_context *ssl ) defined(POLARSSL_KEY_EXCHANGE__WITH_CERT__ENABLED) case TLS_EXT_SIG_ALG: SSL_DEBUG_MSG( 3, ( "found signature_algorithms extension" ) ); - #if defined(POLARSSL_SSL_RENEGOTIATION) - if( ssl->renegotiation == SSL_RENEGOTIATION ) - break; - #endif ret = ssl_parse_signature_algorithms_ext( ssl, ext + 4, ext_size ); if( ret != 0 )