openssl-CVE-2009-1378.patch 885 B

123456789101112131415161718192021
  1. diff -Nura openssl-0.9.8l/ssl/d1_both.c openssl-0.9.8l-CVE-2009-1378/ssl/d1_both.c
  2. --- openssl-0.9.8l/ssl/d1_both.c 2007-10-17 18:17:49.000000000 -0300
  3. +++ openssl-0.9.8l-CVE-2009-1378/ssl/d1_both.c 2009-11-10 13:20:02.000000000 -0300
  4. @@ -561,7 +561,16 @@
  5. if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len)
  6. goto err;
  7. - if (msg_hdr->seq <= s->d1->handshake_read_seq)
  8. + /* Try to find item in queue, to prevent duplicate entries */
  9. + pq_64bit_init(&seq64);
  10. + pq_64bit_assign_word(&seq64, msg_hdr->seq);
  11. + item = pqueue_find(s->d1->buffered_messages, seq64);
  12. + pq_64bit_free(&seq64);
  13. +
  14. + /* Discard the message if sequence number was already there, is
  15. + * too far in the future or the fragment is already in the queue */
  16. + if (msg_hdr->seq <= s->d1->handshake_read_seq ||
  17. + msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL)
  18. {
  19. unsigned char devnull [256];