summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/t1_enc.c')
-rw-r--r--src/lib/libssl/t1_enc.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c
index 6c376be2e0..875aae36b0 100644
--- a/src/lib/libssl/t1_enc.c
+++ b/src/lib/libssl/t1_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t1_enc.c,v 1.128 2021/01/07 15:32:59 jsing Exp $ */ 1/* $OpenBSD: t1_enc.c,v 1.129 2021/01/19 19:07:39 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -562,7 +562,21 @@ tls1_change_cipher_state(SSL *s, int which)
562 562
563 if (key_block - S3I(s)->hs.key_block != S3I(s)->hs.key_block_len) { 563 if (key_block - S3I(s)->hs.key_block != S3I(s)->hs.key_block_len) {
564 SSLerror(s, ERR_R_INTERNAL_ERROR); 564 SSLerror(s, ERR_R_INTERNAL_ERROR);
565 goto err2; 565 goto err;
566 }
567
568 if (is_read) {
569 if (!tls12_record_layer_change_read_cipher_state(s->internal->rl,
570 mac_secret, mac_secret_size, key, key_len, iv, iv_len))
571 goto err;
572 tls12_record_layer_set_read_seq_num(s->internal->rl,
573 S3I(s)->read_sequence);
574 } else {
575 if (!tls12_record_layer_change_write_cipher_state(s->internal->rl,
576 mac_secret, mac_secret_size, key, key_len, iv, iv_len))
577 goto err;
578 tls12_record_layer_set_write_seq_num(s->internal->rl,
579 S3I(s)->write_sequence);
566 } 580 }
567 581
568 if (aead != NULL) { 582 if (aead != NULL) {
@@ -573,7 +587,7 @@ tls1_change_cipher_state(SSL *s, int which)
573 return tls1_change_cipher_state_cipher(s, is_read, 587 return tls1_change_cipher_state_cipher(s, is_read,
574 mac_secret, mac_secret_size, key, key_len, iv, iv_len); 588 mac_secret, mac_secret_size, key, key_len, iv, iv_len);
575 589
576err2: 590 err:
577 return (0); 591 return (0);
578} 592}
579 593