diff options
author | jsing <> | 2020-08-11 19:21:54 +0000 |
---|---|---|
committer | jsing <> | 2020-08-11 19:21:54 +0000 |
commit | d230ee9311d084ffdf26d4c970e7b5dade552eb4 (patch) | |
tree | 59f08b54c5aa744cdd381d64f1f5737d4b4285c1 /src | |
parent | 880ea195eca4d4670a18be746a2ed8af2fbae1bf (diff) | |
download | openbsd-d230ee9311d084ffdf26d4c970e7b5dade552eb4.tar.gz openbsd-d230ee9311d084ffdf26d4c970e7b5dade552eb4.tar.bz2 openbsd-d230ee9311d084ffdf26d4c970e7b5dade552eb4.zip |
Increment the epoch in the same place for both read and write.
ok inoguchi@ tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/d1_pkt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index 9ea694f605..4a6b3b7dcf 100644 --- a/src/lib/libssl/d1_pkt.c +++ b/src/lib/libssl/d1_pkt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_pkt.c,v 1.79 2020/08/11 19:13:35 jsing Exp $ */ | 1 | /* $OpenBSD: d1_pkt.c,v 1.80 2020/08/11 19:21:54 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -1427,14 +1427,14 @@ dtls1_reset_seq_numbers(SSL *s, int rw) | |||
1427 | unsigned int seq_bytes = sizeof(S3I(s)->read_sequence); | 1427 | unsigned int seq_bytes = sizeof(S3I(s)->read_sequence); |
1428 | 1428 | ||
1429 | if (rw & SSL3_CC_READ) { | 1429 | if (rw & SSL3_CC_READ) { |
1430 | seq = S3I(s)->read_sequence; | ||
1431 | D1I(s)->r_epoch++; | 1430 | D1I(s)->r_epoch++; |
1431 | seq = S3I(s)->read_sequence; | ||
1432 | memcpy(&(D1I(s)->bitmap), &(D1I(s)->next_bitmap), sizeof(DTLS1_BITMAP)); | 1432 | memcpy(&(D1I(s)->bitmap), &(D1I(s)->next_bitmap), sizeof(DTLS1_BITMAP)); |
1433 | memset(&(D1I(s)->next_bitmap), 0, sizeof(DTLS1_BITMAP)); | 1433 | memset(&(D1I(s)->next_bitmap), 0, sizeof(DTLS1_BITMAP)); |
1434 | } else { | 1434 | } else { |
1435 | D1I(s)->w_epoch++; | ||
1435 | seq = S3I(s)->write_sequence; | 1436 | seq = S3I(s)->write_sequence; |
1436 | memcpy(D1I(s)->last_write_sequence, seq, sizeof(S3I(s)->write_sequence)); | 1437 | memcpy(D1I(s)->last_write_sequence, seq, sizeof(S3I(s)->write_sequence)); |
1437 | D1I(s)->w_epoch++; | ||
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | memset(seq, 0, seq_bytes); | 1440 | memset(seq, 0, seq_bytes); |