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.
diff --git a/ChangeLog b/ChangeLog
index e431d8d..9e025da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,9 @@
* 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 146f283..0f0369a 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -1675,10 +1675,6 @@
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 )