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.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index bde13c99e5..bbf2e8e538 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.90 2021/01/19 19:07:39 jsing Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.91 2021/01/26 14:22:19 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.
@@ -205,9 +205,6 @@ dtls1_copy_record(SSL *s, DTLS1_RECORD_DATA_INTERNAL *rdata)
205 memcpy(&(S3I(s)->rbuf), &(rdata->rbuf), sizeof(SSL3_BUFFER_INTERNAL)); 205 memcpy(&(S3I(s)->rbuf), &(rdata->rbuf), sizeof(SSL3_BUFFER_INTERNAL));
206 memcpy(&(S3I(s)->rrec), &(rdata->rrec), sizeof(SSL3_RECORD_INTERNAL)); 206 memcpy(&(S3I(s)->rrec), &(rdata->rrec), sizeof(SSL3_RECORD_INTERNAL));
207 207
208 /* Set proper sequence number for mac calculation */
209 memcpy(&(S3I(s)->read_sequence[2]), &(rdata->packet[5]), 6);
210
211 return (1); 208 return (1);
212} 209}
213 210
@@ -419,10 +416,6 @@ again:
419 if (!CBS_get_u16(&header, &len)) 416 if (!CBS_get_u16(&header, &len))
420 goto again; 417 goto again;
421 418
422 if (!CBS_write_bytes(&seq_no, &(S3I(s)->read_sequence[2]),
423 sizeof(S3I(s)->read_sequence) - 2, NULL))
424 goto again;
425
426 if (!CBS_write_bytes(&seq_no, &rr->seq_num[2], 419 if (!CBS_write_bytes(&seq_no, &rr->seq_num[2],
427 sizeof(rr->seq_num) - 2, NULL)) 420 sizeof(rr->seq_num) - 2, NULL))
428 goto again; 421 goto again;
@@ -1241,12 +1234,8 @@ dtls1_reset_seq_numbers(SSL *s, int rw)
1241 memcpy(&(D1I(s)->bitmap), &(D1I(s)->next_bitmap), 1234 memcpy(&(D1I(s)->bitmap), &(D1I(s)->next_bitmap),
1242 sizeof(DTLS1_BITMAP)); 1235 sizeof(DTLS1_BITMAP));
1243 memset(&(D1I(s)->next_bitmap), 0, sizeof(DTLS1_BITMAP)); 1236 memset(&(D1I(s)->next_bitmap), 0, sizeof(DTLS1_BITMAP));
1244 memset(S3I(s)->read_sequence, 0, sizeof(S3I(s)->read_sequence));
1245 } else { 1237 } else {
1246 D1I(s)->w_epoch++; 1238 D1I(s)->w_epoch++;
1247 tls12_record_layer_set_write_epoch(s->internal->rl, D1I(s)->w_epoch); 1239 tls12_record_layer_set_write_epoch(s->internal->rl, D1I(s)->w_epoch);
1248 memcpy(D1I(s)->last_write_sequence, S3I(s)->write_sequence,
1249 sizeof(S3I(s)->write_sequence));
1250 memset(S3I(s)->write_sequence, 0, sizeof(S3I(s)->write_sequence));
1251 } 1240 }
1252} 1241}