|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
diff -up openssl-0.9.8k/crypto/pqueue/pqueue.c.dtls-dos openssl-0.9.8k/crypto/pqueue/pqueue.c
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
--- openssl-0.9.8k/crypto/pqueue/pqueue.c.dtls-dos 2005-06-28 14:53:33.000000000 +0200
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+++ openssl-0.9.8k/crypto/pqueue/pqueue.c 2009-05-21 18:26:29.000000000 +0200
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
@@ -234,3 +234,17 @@ pqueue_next(pitem **item)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
return ret;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
}
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+int
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+pqueue_size(pqueue_s *pq)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ pitem *item = pq->items;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ int count = 0;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ while(item != NULL)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ {
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ count++;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ item = item->next;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ return count;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
diff -up openssl-0.9.8k/crypto/pqueue/pqueue.h.dtls-dos openssl-0.9.8k/crypto/pqueue/pqueue.h
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
--- openssl-0.9.8k/crypto/pqueue/pqueue.h.dtls-dos 2009-04-21 11:43:58.000000000 +0200
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+++ openssl-0.9.8k/crypto/pqueue/pqueue.h 2009-05-21 18:26:29.000000000 +0200
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
@@ -91,5 +91,6 @@ pitem *pqueue_iterator(pqueue pq);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
pitem *pqueue_next(piterator *iter);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
void pqueue_print(pqueue pq);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+int pqueue_size(pqueue pq);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
#endif /* ! HEADER_PQUEUE_H */
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
diff -up openssl-0.9.8k/ssl/d1_both.c.dtls-dos openssl-0.9.8k/ssl/d1_both.c
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
--- openssl-0.9.8k/ssl/d1_both.c.dtls-dos 2007-10-17 23:17:49.000000000 +0200
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+++ openssl-0.9.8k/ssl/d1_both.c 2009-05-21 18:26:29.000000000 +0200
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
@@ -519,6 +519,7 @@ dtls1_retrieve_buffered_fragment(SSL *s,
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
if ( s->d1->handshake_read_seq == frag->msg_header.seq)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
{
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ unsigned long frag_len = frag->msg_header.frag_len;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
pqueue_pop(s->d1->buffered_messages);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
al=dtls1_preprocess_fragment(s,&frag->msg_header,max);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
@@ -536,7 +537,7 @@ dtls1_retrieve_buffered_fragment(SSL *s,
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
if (al==0)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
{
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
*ok = 1;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
- return frag->msg_header.frag_len;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ return frag_len;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
}
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
ssl3_send_alert(s,SSL3_AL_FATAL,al);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
@@ -561,7 +562,16 @@ dtls1_process_out_of_seq_message(SSL *s,
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
goto err;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
- if (msg_hdr->seq <= s->d1->handshake_read_seq)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ /* Try to find item in queue, to prevent duplicate entries */
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ pq_64bit_init(&seq64);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ pq_64bit_assign_word(&seq64, msg_hdr->seq);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ item = pqueue_find(s->d1->buffered_messages, seq64);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ pq_64bit_free(&seq64);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ /* Discard the message if sequence number was already there, is
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ * too far in the future or the fragment is already in the queue */
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ if (msg_hdr->seq <= s->d1->handshake_read_seq ||
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
{
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
unsigned char devnull [256];
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
diff -up openssl-0.9.8k/ssl/d1_pkt.c.dtls-dos openssl-0.9.8k/ssl/d1_pkt.c
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
--- openssl-0.9.8k/ssl/d1_pkt.c.dtls-dos 2009-04-21 11:44:02.000000000 +0200
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+++ openssl-0.9.8k/ssl/d1_pkt.c 2009-05-21 18:26:29.000000000 +0200
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
@@ -167,6 +167,10 @@ dtls1_buffer_record(SSL *s, record_pqueu
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
DTLS1_RECORD_DATA *rdata;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
pitem *item;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ /* Limit the size of the queue to prevent DOS attacks */
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ if (pqueue_size(queue->q) >= 100)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+ return 0;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
+
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA));
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
item = pitem_new(priority, rdata);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
2452420 |
if (rdata == NULL || item == NULL)
|