aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip.h
diff options
context:
space:
mode:
authorBruce M Simpson <bms@FreeBSD.org>2004-02-11 04:26:04 +0000
committerBruce M Simpson <bms@FreeBSD.org>2004-02-11 04:26:04 +0000
commit1cfd4b5326854e594bfcd5f31dec0f2b52ccaa71 (patch)
tree7a14054c69fb5681c86f54e9b66a9128c1e16003 /sys/netinet/ip.h
parent33febf93d6e69967393353136a9e3a0829e1bd10 (diff)
downloadsrc-1cfd4b5326854e594bfcd5f31dec0f2b52ccaa71.tar.gz
src-1cfd4b5326854e594bfcd5f31dec0f2b52ccaa71.zip
Initial import of RFC 2385 (TCP-MD5) digest support.
This is the first of two commits; bringing in the kernel support first. This can be enabled by compiling a kernel with options TCP_SIGNATURE and FAST_IPSEC. For the uninitiated, this is a TCP option which provides for a means of authenticating TCP sessions which came into being before IPSEC. It is still relevant today, however, as it is used by many commercial router vendors, particularly with BGP, and as such has become a requirement for interconnect at many major Internet points of presence. Several parts of the TCP and IP headers, including the segment payload, are digested with MD5, including a shared secret. The PF_KEY interface is used to manage the secrets using security associations in the SADB. There is a limitation here in that as there is no way to map a TCP flow per-port back to an SPI without polluting tcpcb or using the SPD; the code to do the latter is unstable at this time. Therefore this code only supports per-host keying granularity. Whilst FAST_IPSEC is mutually exclusive with KAME IPSEC (and thus IPv6), TCP_SIGNATURE applies only to IPv4. For the vast majority of prospective users of this feature, this will not pose any problem. This implementation is output-only; that is, the option is honoured when responding to a host initiating a TCP session, but no effort is made [yet] to authenticate inbound traffic. This is, however, sufficient to interwork with Cisco equipment. Tested with a Cisco 2501 running IOS 12.0(27), and Quagga 0.96.4 with local patches. Patches for tcpdump to validate TCP-MD5 sessions are also available from me upon request. Sponsored by: sentex.net
Notes
Notes: svn path=/head/; revision=125680
Diffstat (limited to 'sys/netinet/ip.h')
-rw-r--r--sys/netinet/ip.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/netinet/ip.h b/sys/netinet/ip.h
index 025ad085d146..aca0432dccf1 100644
--- a/sys/netinet/ip.h
+++ b/sys/netinet/ip.h
@@ -193,4 +193,16 @@ struct ip_timestamp {
#define IP_MSS 576 /* default maximum segment size */
+/*
+ * This is the real IPv4 pseudo header, used for computing the TCP and UDP
+ * checksums. For the Internet checksum, struct ipovly can be used instead.
+ * For stronger checksums, the real thing must be used.
+ */
+struct ippseudo {
+ struct in_addr ippseudo_src; /* source internet address */
+ struct in_addr ippseudo_dst; /* destination internet address */
+ u_int8_t ippseudo_pad; /* pad, must be zero */
+ u_int8_t ippseudo_p; /* protocol */
+ u_int16_t ippseudo_len; /* protocol length */
+} __packed;
#endif