NetBSD/lib
jonathan 887b782b0b Initial commit of a port of the FreeBSD implementation of RFC 2385
(MD5 signatures for TCP, as used with BGP).  Credit for original
FreeBSD code goes to Bruce M. Simpson, with FreeBSD sponsorship
credited to sentex.net.  Shortening of the setsockopt() name
attributed to Vincent Jardin.

This commit is a minimal, working version of the FreeBSD code, as
MFC'ed to FreeBSD-4. It has received minimal testing with a ttcp
modified to set the TCP-MD5 option; BMS's additions to tcpdump-current
(tcpdump -M) confirm that the MD5 signatures are correct.  Committed
as-is for further testing between a NetBSD BGP speaker (e.g., quagga)
and industry-standard BGP speakers (e.g., Cisco, Juniper).


NOTE: This version has two potential flaws. First, I do see any code
that verifies recieved TCP-MD5 signatures.  Second, the TCP-MD5
options are internally padded and assumed to be 32-bit aligned. A more
space-efficient scheme is to pack all TCP options densely (and
possibly unaligned) into the TCP header ; then do one final padding to
a 4-byte boundary.  Pre-existing comments note that accounting for
TCP-option space when we add SACK is yet to be done. For now, I'm
punting on that; we can solve it properly, in a way that will handle
SACK blocks, as a separate exercise.

In case a pullup to NetBSD-2 is requested, this adds sys/netipsec/xform_tcp.c
,and modifies:

sys/net/pfkeyv2.h,v 1.15
sys/netinet/files.netinet,v 1.5
sys/netinet/ip.h,v 1.25
sys/netinet/tcp.h,v 1.15
sys/netinet/tcp_input.c,v 1.200
sys/netinet/tcp_output.c,v 1.109
sys/netinet/tcp_subr.c,v 1.165
sys/netinet/tcp_usrreq.c,v 1.89
sys/netinet/tcp_var.h,v 1.109
sys/netipsec/files.netipsec,v 1.3
sys/netipsec/ipsec.c,v 1.11
sys/netipsec/ipsec.h,v 1.7
sys/netipsec/key.c,v 1.11
share/man/man4/tcp.4,v 1.16
lib/libipsec/pfkey.c,v 1.20
lib/libipsec/pfkey_dump.c,v 1.17
lib/libipsec/policy_token.l,v 1.8
sbin/setkey/parse.y,v 1.14
sbin/setkey/setkey.8,v 1.27
sbin/setkey/token.l,v 1.15

Note that the preceding two revisions to tcp.4 will be
required to cleanly apply this diff.
2004-04-25 22:25:03 +00:00
..
csu Include bsd.own.mk before testing MKPIC 2004-03-09 20:04:00 +00:00
i18n_module Cleanup last commit a bit. 2003-12-13 04:34:24 +00:00
libarch Two grammar fixes from jmc@openbsd. 2004-03-13 23:46:37 +00:00
libasn1 Rework how dependency generation is performed: 2003-08-01 17:03:41 +00:00
libbsdmalloc Move UCB-licensed code from 4-clause to 3-clause licence. 2003-08-07 16:42:00 +00:00
libbz2 Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc). 2002-08-19 09:41:27 +00:00
libc POSIX-2001: Change the `who' argument to [gs]etpriority(2) from int 2004-04-25 22:18:08 +00:00
libcdk Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc). 2002-08-19 09:41:27 +00:00
libcom_err The config.h we get when building as a host tool is the libnbcompat 2002-09-13 18:30:43 +00:00
libcompat Append to AFLAGS rather than setting AINC. 2004-04-18 04:26:15 +00:00
libcrypt Move UCB-licensed code from 4-clause to 3-clause licence. 2003-08-07 16:42:00 +00:00
libcrypto Actually install the new man pages. 2004-03-22 00:48:04 +00:00
libcrypto_idea adopted changes made to libcrypto/Makefile: 2002-09-01 06:01:13 +00:00
libcrypto_mdc2 MDC2 is a patented algorithm; don't ship it in default libcrypto. 2002-09-26 13:05:54 +00:00
libcrypto_rc5 adopted changes made to libcrypto/Makefile: 2002-09-01 06:01:13 +00:00
libcurses s/the the/the/ (only in sources that aren't regularly imported from 2004-04-23 02:58:27 +00:00
libdes Various typo fixes from Jonathon Gray via jmc@openbsd. 2003-11-17 11:16:10 +00:00
libedit Remove duplicate word, from jfb@openbsd via jmc@openbsd. 2004-04-15 08:13:29 +00:00
libevent fix a bad realloc; from awohl@chessclub 2003-10-11 18:30:09 +00:00
libform s/the the/the/ (only in sources that aren't regularly imported from 2004-04-23 02:58:27 +00:00
libgssapi Merge changes between heimdal-0.6 and heimdal-0.6.1 2004-04-02 14:59:46 +00:00
libhdb * Bump the shlib major of libkrb5 because the shlib major of libcrypto 2003-10-09 04:40:26 +00:00
libintl Don't convert text if *.mo doesn't specify codeset. 2004-03-13 04:58:04 +00:00
libipsec Initial commit of a port of the FreeBSD implementation of RFC 2385 2004-04-25 22:25:03 +00:00
libkadm Rename a large chunk of the make(1) variables which refer to a 2003-07-10 10:33:58 +00:00
libkadm5clnt * Bump the shlib major of libkrb5 because the shlib major of libcrypto 2003-10-09 04:40:26 +00:00
libkadm5srv * Bump the shlib major of libkrb5 because the shlib major of libcrypto 2003-10-09 04:40:26 +00:00
libkafs * Bump the shlib major of libkrb5 because the shlib major of libcrypto 2003-10-09 04:40:26 +00:00
libkdb heimdal builds shouldn't dig into openssl source by -Ifoo. 2002-08-29 01:31:27 +00:00
libkrb upgrade openssl to 0.9.7b. (AES is now supported) 2003-07-24 14:16:30 +00:00
libkrb5 bump minor version on libkrb5 2004-04-04 14:01:05 +00:00
libkstream no longer need to -I/usr/include first (yes, it's still confusing, i admit) 2003-07-23 13:35:13 +00:00
libkvm Use new PTRTOUINT64() macro instead of local PTRTOINT64() macro. 2004-02-19 03:57:56 +00:00
libl Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc). 2002-08-19 09:41:27 +00:00
libm Typo fix, from skrueger at europe com. 2004-03-22 13:41:09 +00:00
libmagic update for 4.08 2004-03-23 08:40:36 +00:00
libmenu Increment major number (to 5) because of the libcurses major number change 2004-03-22 19:01:28 +00:00
libossaudio drop whitespace 2003-11-18 22:42:04 +00:00
libpcap Do runtime dynamic binary-search for maximum obtainable bpf capture 2004-01-20 23:31:20 +00:00
libpci Bump to 1.0: incompatible pci_devinfo() argument change. 2004-04-24 09:57:13 +00:00
libpmc Include string.h for strcmp. 2003-05-21 20:29:51 +00:00
libposix Append to AFLAGS rather than setting AINC. 2004-04-18 04:26:15 +00:00
libpthread s/the the/the/ (only in sources that aren't regularly imported from 2004-04-23 02:58:27 +00:00
libpthread_dbg Actually test pthread__dbg to check if another gdb is attached (and not 2004-02-21 20:48:11 +00:00
libresolv Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc). 2002-08-19 09:41:27 +00:00
librmt Use 2003-04-16 13:34:34 +00:00
libroken version 12.3 2002-09-12 13:39:53 +00:00
librpcsvc bootparams, not bootparms. 2003-12-25 19:01:35 +00:00
librt Check for __weak_alias macro before using it. 2003-12-07 12:53:19 +00:00
libskey Grammar, spelling, markup fixes from jmc@openbsd. 2003-06-06 13:42:49 +00:00
libsl Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc). 2002-08-19 09:41:27 +00:00
libss Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc). 2002-08-19 09:41:27 +00:00
libssl switch to openssl 0.9.7b 2003-07-24 14:28:57 +00:00
libtelnet sprinkle const. 2004-04-23 17:54:02 +00:00
libterm adjust to constification of cgetent() 2004-04-23 14:49:18 +00:00
libusbhid The report size is not a local item, so don't clear it when clearing local items. 2004-01-05 17:55:48 +00:00
libutil sprinkle const 2004-04-23 15:23:26 +00:00
libvers Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc). 2002-08-19 09:41:27 +00:00
libwrap Move Matt Green's code from a 4-clause to a 3-clause licence by removing 2003-10-13 14:22:20 +00:00
liby Move UCB-licensed code from 4-clause to 3-clause licence. 2003-08-07 16:42:00 +00:00
libz Call it Adler-32 consistently. From jmc@openbsd. 2004-03-05 01:30:52 +00:00
Makefile Fix the checkflist for builds without Kerberos 4 (MKKERBEROS4=no) 2003-12-11 09:46:26 +00:00
Makefile.inc
bumpversion netbsd.org->NetBSD.org 2003-07-26 19:24:24 +00:00
checkoldver add a pair of double quotes. 2003-10-25 07:53:12 +00:00
checkver
checkvers