[8.09] openssl: fix 4 DoS vulnerabilities in DTLS
[openwrt/svn-archive/archive.git] / package / openssl / patches / 403-cve-2009-1378.patch
1 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1378
2
3 --- a/ssl/d1_both.c
4 +++ b/ssl/d1_both.c
5 @@ -561,7 +561,16 @@ dtls1_process_out_of_seq_message(SSL *s,
6 if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len)
7 goto err;
8
9 - if (msg_hdr->seq <= s->d1->handshake_read_seq)
10 + /* Try to find item in queue, to prevent duplicate entries */
11 + pq_64bit_init(&seq64);
12 + pq_64bit_assign_word(&seq64, msg_hdr->seq);
13 + item = pqueue_find(s->d1->buffered_messages, seq64);
14 + pq_64bit_free(&seq64);
15 +
16 + /* Discard the message if sequence number was already there, is
17 + * too far in the future or the fragment is already in the queue */
18 + if (msg_hdr->seq <= s->d1->handshake_read_seq ||
19 + msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL)
20 {
21 unsigned char devnull [256];
22