OpenBSD CVS

CVS log for src/usr.sbin/tcpdump/print-ike.c


[BACK] Up to [local] / src / usr.sbin / tcpdump

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.41 / (download) - annotate - [select for diffs], Wed Dec 28 21:30:19 2022 UTC (17 months, 1 week ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech

Revision 1.40 / (download) - annotate - [select for diffs], Wed Dec 1 18:28:46 2021 UTC (2 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.39: +1 -3 lines
Diff to previous 1.39 (colored)

we do not need 'struct mbuf; struct rtentry;' to satisfy some ancient unix
variant that made a header file mistake.
ok jsg

Revision 1.39 / (download) - annotate - [select for diffs], Fri Jan 24 22:46:36 2020 UTC (4 years, 4 months ago) by procter
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.38: +4 -4 lines
Diff to previous 1.38 (colored)

- (void)printf() -> printf(); the cast adds clutter for little value.
- fprintf(stdout, ...) -> printf()
- fputs(x, stdout) -> printf(); for consistency.
fputs is twice as fast on atom x5-Z8300@1.44GHz but Amdahl sees a pure printf
tcpdump only 2% slower than a pure fputs (for constant strings) tcpdump
to /dev/null across a 20MB/~170k packet pcap file.

ok dlg@ for fputs and ok tedu@ krw@ deraadt@ a2k19 for the rest

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jul 6 05:47:22 2018 UTC (5 years, 11 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.37: +2 -4 lines
Diff to previous 1.37 (colored)

Rework UDP parsing, particularly around IP addresses.

This originally started as trying to put a consistent space between
the UDP header information and the payload parsing, but while doing
that I noticed inconsistent IPv4 vs IPv6 handling.

Apart from the default "srcip.srcport > dstip.dstpor" output, all
the other places that IP addresses were printed assumed IPv4. It
looks like it is possible that udp_print() can be called without
an IP header, which made these blind IPv4 prints turn into NULL
derefs.

This fixes the problem above by only having a single place that
prints the addresses out, and makes sure to get the difference
between IPv4, IPv6 and no IP correct.

This changes how the checksum is calculated. It incrementally builds
the UDP checksum by feeding the IPv4 and v6 addresses in separately,
then using common code for the rest of the pseudo header and actual
payload.

Lastly, this does make printing the space between the UDP header
and its payload consistent. The UDP code is now responsible for
adding a space after itself so the payload parsers don't have to.
They got it wrong in some cases anyway, so this should be a lot
more uniform.

help and ok sthen@

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:21 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.36: +1 -2 lines
Diff to previous 1.36 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jan 28 13:47:55 2012 UTC (12 years, 4 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.35: +5 -4 lines
Diff to previous 1.35 (colored)

Print names rather than numbers for the old draft nat-t attributes,
cisco use these at least as recently as ASAs running 8.4(1)

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jun 7 16:20:58 2010 UTC (14 years ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.34: +7 -3 lines
Diff to previous 1.34 (colored)

minimal decode support for IKEv2 exchange types and payloads.

ok deraadt@ sthen@

Revision 1.34 / (download) - annotate - [select for diffs], Wed Jan 20 15:19:25 2010 UTC (14 years, 4 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.33: +10 -1 lines
Diff to previous 1.33 (colored)

Print RFC3947 NAT Original Address (NAT-OA) payloads, they're a subset
of the id payload, so using the existing id printer. ok dlg@

Revision 1.33 / (download) - annotate - [select for diffs], Thu Nov 12 16:07:41 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.32: +4 -2 lines
Diff to previous 1.32 (colored)

for packets with unknown payloads (outside the range of our knowledge) simply
treat them the same as truncated packets
ok sthen

Revision 1.32 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:55 2009 UTC (14 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.31: +1 -6 lines
Diff to previous 1.31 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.31 / (download) - annotate - [select for diffs], Thu Dec 18 16:18:49 2008 UTC (15 years, 5 months ago) by hshoexer
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.30: +26 -23 lines
Diff to previous 1.30 (colored)

Instead of directly applying ntoh*() to fields of the captured
packet and thus modifying it use local varialbes instead.  Otherwise,
hexdumping packets shows corrupted data.

ok markus@ some time ago

Revision 1.30 / (download) - annotate - [select for diffs], Sun Oct 7 16:41:05 2007 UTC (16 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

trash $Header goo which is just annoying; 5595

Revision 1.29 / (download) - annotate - [select for diffs], Thu Aug 24 12:13:16 2006 UTC (17 years, 9 months ago) by hshoexer
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

recognize xauth vendor payload
ok ho markus

Revision 1.25.2.1 / (download) - annotate - [select for diffs], Sun Sep 4 19:06:37 2005 UTC (18 years, 9 months ago) by brad
Branch: OPENBSD_3_6
Changes since 1.25: +12 -5 lines
Diff to previous 1.25 (colored) next main 1.26 (colored)

MFC:
Fix by cloder@

Fix a reliability issue where an over-read of 4 bytes could result in the
tcpdump process being terminated when tcpdump running with -vv tries to
print a short IKE SA payload.

ok deraadt@ cloder@

Revision 1.26.2.1 / (download) - annotate - [select for diffs], Sun Sep 4 18:47:41 2005 UTC (18 years, 9 months ago) by brad
Branch: OPENBSD_3_7
Changes since 1.26: +12 -5 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

MFC:
Fix by cloder@

Fix a reliability issue where an over-read of 4 bytes could result in the
tcpdump process being terminated when tcpdump running with -vv tries to
print a short IKE SA payload.

ok deraadt@ cloder@

Revision 1.28 / (download) - annotate - [select for diffs], Sun Aug 28 18:37:55 2005 UTC (18 years, 9 months ago) by cloder
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.27: +12 -5 lines
Diff to previous 1.27 (colored)

Fix a reliability issue where an over-read of 4 bytes could result in the
tcpdump process being terminated when tcpdump running with -vv tries to
print a a short IKE SA payload.

Specifically OK'd for 3.8 release by deraadt@.  OK canacar@, hshoexer@.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jun 28 09:28:28 2005 UTC (18 years, 11 months ago) by hshoexer
Branch: MAIN
Changes since 1.26: +9 -2 lines
Diff to previous 1.26 (colored)

some more ike payload types

ok ho@

Revision 1.26 / (download) - annotate - [select for diffs], Thu Oct 7 09:50:48 2004 UTC (19 years, 8 months ago) by hshoexer
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE
Branch point for: OPENBSD_3_7
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

When printing attributes do not cast unsigned value to signed.

ok & help otto
ok deraadt henning markus

Revision 1.25 / (download) - annotate - [select for diffs], Thu Jul 29 10:29:44 2004 UTC (19 years, 10 months ago) by ho
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE
Branch point for: OPENBSD_3_6
Changes since 1.24: +19 -4 lines
Diff to previous 1.24 (colored)

Report DPD notifications. Cleanup. markus@ ok.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Jun 22 03:23:33 2004 UTC (19 years, 11 months ago) by ho
Branch: MAIN
Changes since 1.23: +26 -7 lines
Diff to previous 1.23 (colored)

In draft-ietf-ipsec-nat-t-ike-01,02,03, NAT-D is payload 130. Rewrite a bit
to understand payloads in the private range. Also match a few "well-known"
vendor-IDs. markus@ "looks ok".

Revision 1.23 / (download) - annotate - [select for diffs], Sun Jun 20 17:51:55 2004 UTC (19 years, 11 months ago) by avsm
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

- do not use __attribute__((volatile)) as its a synonym for __dead nowadays
- bad format string "\%s" -> "%s" in print-ike.c
fixes parsing using CIL, discussed with millert@ niklas@

Revision 1.22 / (download) - annotate - [select for diffs], Tue Apr 13 17:56:54 2004 UTC (20 years, 2 months ago) by hshoexer
Branch: MAIN
Changes since 1.21: +204 -75 lines
Diff to previous 1.21 (colored)

Cleanup and more careful payload parsing.

ok ho@

Revision 1.21 / (download) - annotate - [select for diffs], Tue Apr 6 08:57:20 2004 UTC (20 years, 2 months ago) by ho
Branch: MAIN
Changes since 1.20: +62 -7 lines
Diff to previous 1.20 (colored)

Print DELETE payload contents. ok markus@.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Mar 12 10:10:42 2004 UTC (20 years, 3 months ago) by hshoexer
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.19: +9 -5 lines
Diff to previous 1.19 (colored)

Check payload size more carefully when printing ike messages.  Identified by
cloder@.

ok ho@ otto@ cloder@

Revision 1.19 / (download) - annotate - [select for diffs], Sat Feb 14 11:36:55 2004 UTC (20 years, 3 months ago) by ho
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

KNF

Revision 1.18 / (download) - annotate - [select for diffs], Sat Feb 14 11:33:45 2004 UTC (20 years, 3 months ago) by ho
Branch: MAIN
Changes since 1.17: +55 -52 lines
Diff to previous 1.17 (colored)

Fix DOI select logic, which was broken for IKE vendors that sends non-zero
spi_size in their phase 1 proposals, such as some DLink VPN routers.
Also replace u_char with u_int8_t.  markus@, hshoexer@ ok.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jan 15 22:59:42 2004 UTC (20 years, 4 months ago) by ho
Branch: MAIN
Changes since 1.16: +4 -5 lines
Diff to previous 1.16 (colored)

Input should be atleast an isakmp_header long. otto@, markus@ ok.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Dec 18 09:14:18 2003 UTC (20 years, 5 months ago) by ho
Branch: MAIN
Changes since 1.15: +6 -2 lines
Diff to previous 1.15 (colored)

Recognize NAT-D and NAT-OA payloads. markus@ ok.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Sep 23 04:10:14 2002 UTC (21 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.14: +3 -2 lines
Diff to previous 1.14 (colored)

Add missing includes, breaks and semicolons to appease gcc3; David Krause
deraadt@ OK

Revision 1.14 / (download) - annotate - [select for diffs], Thu Jul 11 16:14:52 2002 UTC (21 years, 11 months ago) by stevesk
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

print FQDN strings using correct length; ok ho@ jakob@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jun 11 18:15:48 2002 UTC (22 years ago) by ho
Branch: MAIN
Changes since 1.12: +10 -7 lines
Diff to previous 1.12 (colored)

For IPCOMP print CPI instead of SPI. Style.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jun 11 18:12:11 2002 UTC (22 years ago) by ho
Branch: MAIN
Changes since 1.11: +10 -8 lines
Diff to previous 1.11 (colored)

Don't assume 32bit SPI/CPI numbers.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jun 11 17:05:13 2002 UTC (22 years ago) by ho
Branch: MAIN
Changes since 1.10: +9 -2 lines
Diff to previous 1.10 (colored)

Decode IPCOMP transform IDs.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Feb 19 19:39:40 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.9: +2 -5 lines
Diff to previous 1.9 (colored)

We live in an ANSI C world.  Remove lots of gratuitous #ifdef __STDC__ cruft.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Nov 12 18:04:08 2001 UTC (22 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +162 -168 lines
Diff to previous 1.8 (colored)

care and KNF

Revision 1.8 / (download) - annotate - [select for diffs], Fri Oct 26 14:14:49 2001 UTC (22 years, 7 months ago) by ho
Branch: MAIN
Changes since 1.7: +3 -5 lines
Diff to previous 1.7 (colored)

(c)-2001.

Revision 1.7 / (download) - annotate - [select for diffs], Wed Apr 18 09:14:14 2001 UTC (23 years, 1 month ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.6: +18 -22 lines
Diff to previous 1.6 (colored)

Correct IKE mode config printouts, ok ho@

Revision 1.6 / (download) - annotate - [select for diffs], Tue Apr 10 16:10:21 2001 UTC (23 years, 2 months ago) by ho
Branch: MAIN
Changes since 1.5: +173 -45 lines
Diff to previous 1.5 (colored)

Add IKE mode-config (as described in draft-dukes-ike-mode-cfg-01.txt)
decoding. Also some cleanup of attribute handling plus length checks.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Apr 9 21:44:40 2001 UTC (23 years, 2 months ago) by ho
Branch: MAIN
Changes since 1.4: +231 -65 lines
Diff to previous 1.4 (colored)

Extend IKE knowledge so we can parse the rest (normally encrypted parts)
of the IKE negotiation. Useful for isakmpd's new -L and -l options.
Also some cleanup. (angelos@, niklas@ ok)

Revision 1.4 / (download) - annotate - [select for diffs], Tue Oct 3 14:25:47 2000 UTC (23 years, 8 months ago) by ho
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.3: +68 -193 lines
Diff to previous 1.3 (colored)

Print IKE notifications (with -v). Style. (jakob@ ok)

Revision 1.3 / (download) - annotate - [select for diffs], Thu Sep 30 07:22:55 1999 UTC (24 years, 8 months ago) by ho
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.2: +331 -53 lines
Diff to previous 1.2 (colored)

Improve tcpdump's IKE/ISAKMP knowledge. (jakob@, hugh@ ok)

Revision 1.2 / (download) - annotate - [select for diffs], Thu Sep 16 17:08:01 1999 UTC (24 years, 8 months ago) by brad
Branch: MAIN
Changes since 1.1: +2 -3 lines
Diff to previous 1.1 (colored)

- #if __STDC__ --> #ifdef __STDC__
- remove unused variables

Revision 1.1 / (download) - annotate - [select for diffs], Wed Jul 28 20:41:36 1999 UTC (24 years, 10 months ago) by jakob
Branch: MAIN

-  Merge some changes from tcpdump 3.4
   -a flag; attempt to convert network and broadcast addresses to names
   Improved signal handling
   Miscellaneous fixes and typos
   OSPF MD5 authentication support

-  -X flag; emacs-hexl print (including ascii)

-  Add ECN bits to TCP and IP headers

-  IKE & IPsec (ESP & AH) support

OK deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.