Fix implementation of VERIFY_OPTIONAL verification mode
This commit changes the behaviour of mbedtls_ssl_parse_certificate
to make the two authentication modes MBEDTLS_SSL_VERIFY_REQUIRED and
MBEDTLS_SSL_VERIFY_OPTIONAL be in the following relationship:
Mode == MBEDTLS_SSL_VERIFY_REQUIRED
<=> Mode == MBEDTLS_SSL_VERIFY_OPTIONAL + check verify result
Also, it changes the behaviour to perform the certificate chain
verification even if the trusted CA chain is empty. Previously, the
function failed in this case, even when using optional verification,
which was brought up in #864.
diff --git a/ChangeLog b/ChangeLog
index 1b6a354..da0755a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,13 @@
that triggered the alert.
* In SSLv3, if refusing a renegotiation attempt, don't process any further
data.
+ * Accept empty trusted CA chain in authentication mode
+ MBEDTLS_SSL_VERIFY_OPTIONAL.
+ Fixes #864. Found by jethrogb.
+ * Fix implementation of mbedtls_ssl_parse_certificate
+ to not annihilate fatal errors in authentication mode
+ MBEDTLS_SSL_VERIFY_OPTIONAL and to reflect bad EC curves
+ within verification result.
Changes
* Send fatal alerts in many more cases instead of dropping the connection.