diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2018-03-16 13:29:51 +0100 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2018-03-19 14:16:54 +0100 |
commit | d4ef4fbf46a51837a54e4a7cd0140eb9f08fdf30 (patch) | |
tree | 1507db0bb8061345eca6f69296477e43aef8e43d /ssl/tls13_enc.c | |
parent | df6d51e2e4599da2c85e04e919bf30db3744af20 (diff) |
Fix a crash in SSLfatal due to invalid enc_write_ctx
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5645)
Diffstat (limited to 'ssl/tls13_enc.c')
-rw-r--r-- | ssl/tls13_enc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ssl/tls13_enc.c b/ssl/tls13_enc.c index 08fbee59fa..7f4395843a 100644 --- a/ssl/tls13_enc.c +++ b/ssl/tls13_enc.c @@ -397,6 +397,7 @@ int tls13_change_cipher_state(SSL *s, int which) RECORD_LAYER_reset_read_sequence(&s->rlayer); } else { + s->statem.invalid_enc_write_ctx = 1; if (s->enc_write_ctx != NULL) { EVP_CIPHER_CTX_reset(s->enc_write_ctx); } else { @@ -609,6 +610,7 @@ int tls13_change_cipher_state(SSL *s, int which) goto err; } + s->statem.invalid_enc_write_ctx = 0; ret = 1; err: OPENSSL_cleanse(secret, sizeof(secret)); @@ -631,6 +633,7 @@ int tls13_update_key(SSL *s, int sending) insecret = s->client_app_traffic_secret; if (sending) { + s->statem.invalid_enc_write_ctx = 1; iv = s->write_iv; ciph_ctx = s->enc_write_ctx; RECORD_LAYER_reset_write_sequence(&s->rlayer); @@ -651,6 +654,7 @@ int tls13_update_key(SSL *s, int sending) memcpy(insecret, secret, hashlen); + s->statem.invalid_enc_write_ctx = 0; ret = 1; err: OPENSSL_cleanse(secret, sizeof(secret)); |