From 4db3e88459e8f5e742f414e49eab50e5be53ebca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lutz=20J=C3=A4nicke?= Date: Mon, 13 Oct 2008 06:43:06 +0000 Subject: [PATCH] Firstly, the bitmap we use for replay protection was ending up with zero length, so a _single_ pair of packets getting switched around would cause one of them to be 'dropped'. Secondly, it wasn't even _dropping_ the offending packets, in the non-blocking case. It was just returning garbage instead. PR: #1752 Submitted by: David Woodhouse --- ssl/d1_lib.c | 1 + ssl/d1_pkt.c | 1 + 2 files changed, 2 insertions(+) diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index fc088b4148..3568e97a87 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -106,6 +106,7 @@ int dtls1_new(SSL *s) pq_64bit_init(&(d1->bitmap.map)); pq_64bit_init(&(d1->bitmap.max_seq_num)); + d1->next_bitmap.length = d1->bitmap.length; pq_64bit_init(&(d1->next_bitmap.map)); pq_64bit_init(&(d1->next_bitmap.max_seq_num)); diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c index b2765ba801..eb56cf987b 100644 --- a/ssl/d1_pkt.c +++ b/ssl/d1_pkt.c @@ -597,6 +597,7 @@ again: /* check whether this is a repeat, or aged record */ if ( ! dtls1_record_replay_check(s, bitmap, &(rr->seq_num))) { + rr->length = 0; s->packet_length=0; /* dump this record */ goto again; /* get another record */ } -- 2.25.1