Fix a crash in tls_construct_client_certificate.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Tue, 13 Jun 2017 05:25:43 +0000 (07:25 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 3 Jul 2017 14:34:33 +0000 (16:34 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3667)

ssl/statem/statem_clnt.c

index 7ab30bdc1e9f174e46013d883a810acc63a99670..53aa1dc0dcb861307384cf96666156a1c54fddb1 100644 (file)
@@ -3320,7 +3320,12 @@ int tls_construct_client_certificate(SSL *s, WPACKET *pkt)
                     SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_WRITE))) {
         SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_CERTIFICATE,
                SSL_R_CANNOT_CHANGE_CIPHER);
-        goto err;
+        /*
+         * This is a fatal error, which leaves
+         * enc_write_ctx in an inconsistent state
+         * and thus ssl3_send_alert may crash.
+         */
+        return 0;
     }
 
     return 1;