From c31ad0bbf8415a691dd833b29e5be66f7c4aba42 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Tue, 13 Jun 2017 07:25:43 +0200 Subject: [PATCH] Fix a crash in tls_construct_client_certificate. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/3667) --- ssl/statem/statem_clnt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index 7ab30bdc1e..53aa1dc0dc 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -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; -- 2.25.1