summaryrefslogtreecommitdiff
path: root/src/lib/libssl/d1_pkt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/d1_pkt.c')
-rw-r--r--src/lib/libssl/d1_pkt.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index 7f4261e47e..4cb26d7ea1 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.93 2021/02/20 14:14:16 tb Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.94 2021/05/02 17:18:10 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.
@@ -869,9 +869,6 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
869 if (!ssl3_do_change_cipher_spec(s)) 869 if (!ssl3_do_change_cipher_spec(s))
870 goto err; 870 goto err;
871 871
872 /* do this whenever CCS is processed */
873 dtls1_reset_seq_numbers(s, SSL3_CC_READ);
874
875 goto start; 872 goto start;
876 } 873 }
877 874
@@ -1219,15 +1216,16 @@ dtls1_get_bitmap(SSL *s, SSL3_RECORD_INTERNAL *rr, unsigned int *is_next_epoch)
1219} 1216}
1220 1217
1221void 1218void
1222dtls1_reset_seq_numbers(SSL *s, int rw) 1219dtls1_reset_read_seq_numbers(SSL *s)
1223{ 1220{
1224 if (rw & SSL3_CC_READ) { 1221 D1I(s)->r_epoch++;
1225 D1I(s)->r_epoch++; 1222 memcpy(&(D1I(s)->bitmap), &(D1I(s)->next_bitmap), sizeof(DTLS1_BITMAP));
1226 memcpy(&(D1I(s)->bitmap), &(D1I(s)->next_bitmap), 1223 memset(&(D1I(s)->next_bitmap), 0, sizeof(DTLS1_BITMAP));
1227 sizeof(DTLS1_BITMAP)); 1224}
1228 memset(&(D1I(s)->next_bitmap), 0, sizeof(DTLS1_BITMAP)); 1225
1229 } else { 1226void
1230 D1I(s)->w_epoch++; 1227dtls1_reset_write_seq_numbers(SSL *s)
1231 tls12_record_layer_set_write_epoch(s->internal->rl, D1I(s)->w_epoch); 1228{
1232 } 1229 D1I(s)->w_epoch++;
1230 tls12_record_layer_set_write_epoch(s->internal->rl, D1I(s)->w_epoch);
1233} 1231}