aboutsummaryrefslogtreecommitdiffstats
path: root/net/ssldump
diff options
context:
space:
mode:
authorerwin <erwin@FreeBSD.org>2009-03-11 17:27:48 +0800
committererwin <erwin@FreeBSD.org>2009-03-11 17:27:48 +0800
commit734170ee5b026d548601e4a913e5ad4449ddd2d9 (patch)
tree5b78acd54150f8908688edb71880a1e063900682 /net/ssldump
parente25d8700f7bf2a9f51e94bfc0133b17bc6ffaaee (diff)
downloadfreebsd-ports-gnome-734170ee5b026d548601e4a913e5ad4449ddd2d9.tar.gz
freebsd-ports-gnome-734170ee5b026d548601e4a913e5ad4449ddd2d9.tar.zst
freebsd-ports-gnome-734170ee5b026d548601e4a913e5ad4449ddd2d9.zip
Fixes for handling out of order TCP segments.
Submitted by: Gregg Stefancik
Diffstat (limited to 'net/ssldump')
-rw-r--r--net/ssldump/Makefile2
-rw-r--r--net/ssldump/files/patch-base_tcppack.c73
2 files changed, 74 insertions, 1 deletions
diff --git a/net/ssldump/Makefile b/net/ssldump/Makefile
index 8cda1bef385b..eccf8334e290 100644
--- a/net/ssldump/Makefile
+++ b/net/ssldump/Makefile
@@ -7,7 +7,7 @@
PORTNAME= ssldump
PORTVERSION= 0.9b3
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net security
MASTER_SITES= http://www.rtfm.com/ssldump/
diff --git a/net/ssldump/files/patch-base_tcppack.c b/net/ssldump/files/patch-base_tcppack.c
new file mode 100644
index 000000000000..a196ea951379
--- /dev/null
+++ b/net/ssldump/files/patch-base_tcppack.c
@@ -0,0 +1,73 @@
+--- base/tcppack.c.orig 2002-09-09 21:02:58.000000000 +0000
++++ base/tcppack.c 2009-03-11 09:09:07.000000000 +0000
+@@ -222,7 +222,6 @@
+ int r,_status;
+ tcp_seq seq,right_edge;
+ segment _seg;
+- segment *seg,*nseg=0;
+ long l;
+
+ l=p->len - p->tcp->th_off * 4;
+@@ -273,35 +272,39 @@
+ if(SEQ_LT(stream->seq,seq)){
+ /* Out of order segment */
+ tcp_seq left_edge;
++ segment **ssn, *nseg=0;
+
+- for(seg=0;seg;seg=seg?seg->next:stream->oo_queue){
+- if(seg->next->s_seq > seq)
++ left_edge = seq;
++ for(ssn=&stream->oo_queue;*ssn;ssn=&(*ssn)->next){
++ if((*ssn)->s_seq > seq)
+ break;
++ left_edge = (*ssn)->s_seq + (*ssn)->len;
+ }
+-
++ /*
++ if seg == 0
++ oo_queue is empty - place out of order segment into oo_queue
++ else
++ place out of order segment into oo_queue after seg
++ */
++
+ if(!(nseg=(segment *)calloc(sizeof(segment),1)))
+ ABORT(R_NO_MEMORY);
+ if(r=packet_copy(p,&nseg->p))
+ ABORT(r);
+ nseg->s_seq=seq;
+-
++
+ /*Insert this segment into the reassembly queue*/
+- if(seg){
+- nseg->next=seg->next;
+- seg->next=nseg;
+- }
+- else{
+- nseg->next=stream->oo_queue;
+- stream->oo_queue=nseg;
+- }
++ nseg->next = *ssn;
++ *ssn = nseg;
+
+- left_edge=seg?seg->s_seq:stream->seq;
+ STRIM(left_edge,nseg);
+ }
+ else{
+ /*First segment -- just thread the unallocated data on the
+ list so we can pass to the analyzer*/
+- _seg.next=0;
++ segment _seg, *seg;
++
++ _seg.next=stream->oo_queue;
+ _seg.p=p;
+ _seg.s_seq=seq;
+
+@@ -422,6 +425,8 @@
+
+ l=_seq - (s)->s_seq; /* number of bytes to trim
+ from the left of s */
++ if(l < 1) return(0);
++
+ off=(s)->p->tcp->th_off*4;
+ if(l>((s)->p->len-off)) ERETURN(R_BAD_DATA);
+