diff options
author | jsing <> | 2021-08-30 19:12:25 +0000 |
---|---|---|
committer | jsing <> | 2021-08-30 19:12:25 +0000 |
commit | cedbde20c0ecfb870c00ce4fe4401f89a9397b6d (patch) | |
tree | 2d39ac8fc8532fdfcf26841981b52bd4c01b1e0f /src/lib/libssl/tls12_record_layer.c | |
parent | abf6f6607dda2d28fb254cd45e519fec1091fc0d (diff) | |
download | openbsd-cedbde20c0ecfb870c00ce4fe4401f89a9397b6d.tar.gz openbsd-cedbde20c0ecfb870c00ce4fe4401f89a9397b6d.tar.bz2 openbsd-cedbde20c0ecfb870c00ce4fe4401f89a9397b6d.zip |
Replace DTLS r_epoch with the read epoch from the TLSv1.2 record layer.
ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/tls12_record_layer.c')
-rw-r--r-- | src/lib/libssl/tls12_record_layer.c | 10 |
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 | ||
298 | uint16_t | 298 | uint16_t |
299 | tls12_record_layer_initial_epoch(struct tls12_record_layer *rl) | 299 | tls12_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 | ||
304 | uint16_t | 304 | uint16_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; |