summaryrefslogtreecommitdiffstats
path: root/ssl/d1_both.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-05-16 16:23:14 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-05-16 16:23:14 +0000
commit481547f0feff816dfee963b518761a9d66d84ea9 (patch)
treef2cd5c190a20587328da72c1b8cf1fd398b15f62 /ssl/d1_both.c
parent8d932f6fd7df8a622f3cb998dab1529247158706 (diff)
Fix from 1.0.0-stable.
Diffstat (limited to 'ssl/d1_both.c')
-rw-r--r--ssl/d1_both.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index 928a005e53..ebc03482f0 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -562,7 +562,16 @@ dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok)
if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len)
goto err;
- if (msg_hdr->seq <= s->d1->handshake_read_seq)
+ /* Try to find item in queue, to prevent duplicate entries */
+ memset(seq64be,0,sizeof(seq64be));
+ seq64be[6] = (unsigned char) (msg_hdr->seq>>8);
+ seq64be[7] = (unsigned char) msg_hdr->seq;
+ item = pqueue_find(s->d1->buffered_messages, seq64be);
+
+ /* Discard the message if sequence number was already there, is
+ * too far in the future or the fragment is already in the queue */
+ if (msg_hdr->seq <= s->d1->handshake_read_seq ||
+ msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL)
{
unsigned char devnull [256];