summaryrefslogtreecommitdiffstats
path: root/ssl/s3_enc.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2018-03-16 13:29:51 +0100
committerBernd Edlinger <bernd.edlinger@hotmail.de>2018-03-19 14:16:54 +0100
commitd4ef4fbf46a51837a54e4a7cd0140eb9f08fdf30 (patch)
tree1507db0bb8061345eca6f69296477e43aef8e43d /ssl/s3_enc.c
parentdf6d51e2e4599da2c85e04e919bf30db3744af20 (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/s3_enc.c')
-rw-r--r--ssl/s3_enc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index f775f26b3d..966d498e61 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -155,6 +155,7 @@ int ssl3_change_cipher_state(SSL *s, int which)
RECORD_LAYER_reset_read_sequence(&s->rlayer);
mac_secret = &(s->s3->read_mac_secret[0]);
} else {
+ s->statem.invalid_enc_write_ctx = 1;
if (s->enc_write_ctx != NULL) {
reuse_dd = 1;
} else if ((s->enc_write_ctx = EVP_CIPHER_CTX_new()) == NULL) {
@@ -238,6 +239,7 @@ int ssl3_change_cipher_state(SSL *s, int which)
goto err;
}
+ s->statem.invalid_enc_write_ctx = 0;
OPENSSL_cleanse(exp_key, sizeof(exp_key));
OPENSSL_cleanse(exp_iv, sizeof(exp_iv));
return 1;