summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls12_record_layer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/tls12_record_layer.c')
-rw-r--r--src/lib/libssl/tls12_record_layer.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/libssl/tls12_record_layer.c b/src/lib/libssl/tls12_record_layer.c
index f59364bb67..6d7d8696eb 100644
--- a/src/lib/libssl/tls12_record_layer.c
+++ b/src/lib/libssl/tls12_record_layer.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls12_record_layer.c,v 1.33 2021/08/30 19:00:49 jsing Exp $ */ 1/* $OpenBSD: tls12_record_layer.c,v 1.34 2021/08/30 19:12:25 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2020 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2020 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -296,9 +296,9 @@ tls12_record_layer_set_initial_epoch(struct tls12_record_layer *rl,
296} 296}
297 297
298uint16_t 298uint16_t
299tls12_record_layer_initial_epoch(struct tls12_record_layer *rl) 299tls12_record_layer_read_epoch(struct tls12_record_layer *rl)
300{ 300{
301 return rl->initial_epoch; 301 return rl->read->epoch;
302} 302}
303 303
304uint16_t 304uint16_t
@@ -580,6 +580,10 @@ tls12_record_layer_change_read_cipher_state(struct tls12_record_layer *rl,
580 580
581 /* Read sequence number gets reset to zero. */ 581 /* Read sequence number gets reset to zero. */
582 582
583 /* DTLS epoch is incremented and is permitted to wrap. */
584 if (rl->dtls)
585 read_new->epoch = rl->read_current->epoch + 1;
586
583 if (!tls12_record_layer_change_cipher_state(rl, read_new, 0, 587 if (!tls12_record_layer_change_cipher_state(rl, read_new, 0,
584 mac_key, key, iv)) 588 mac_key, key, iv))
585 goto err; 589 goto err;