summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2004-02-11 04:26:04 +0000
committerbms <bms@FreeBSD.org>2004-02-11 04:26:04 +0000
commit903cdeea1a6d0c99fecc1d8aeeab65bdfbab46d7 (patch)
tree7a14054c69fb5681c86f54e9b66a9128c1e16003 /sys/net
parentdfc906ec95fc478c611f5ef93b40dc04b3ecb6e8 (diff)
downloadFreeBSD-src-903cdeea1a6d0c99fecc1d8aeeab65bdfbab46d7.zip
FreeBSD-src-903cdeea1a6d0c99fecc1d8aeeab65bdfbab46d7.tar.gz
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
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pfkeyv2.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/pfkeyv2.h b/sys/net/pfkeyv2.h
index 4a3fc84..a164f3b 100644
--- a/sys/net/pfkeyv2.h
+++ b/sys/net/pfkeyv2.h
@@ -286,7 +286,8 @@ struct sadb_x_ipsecrequest {
#define SADB_SATYPE_MIP 8
#define SADB_X_SATYPE_IPCOMP 9
/*#define SADB_X_SATYPE_POLICY 10 obsolete, do not reuse */
-#define SADB_SATYPE_MAX 11
+#define SADB_X_SATYPE_TCPSIGNATURE 11
+#define SADB_SATYPE_MAX 12
#define SADB_SASTATE_LARVAL 0
#define SADB_SASTATE_MATURE 1
@@ -300,7 +301,7 @@ struct sadb_x_ipsecrequest {
#define SADB_AALG_NONE 0
#define SADB_AALG_MD5HMAC 2
#define SADB_AALG_SHA1HMAC 3
-#define SADB_AALG_MAX 251
+#define SADB_AALG_MAX 252
/* private allocations - based on RFC2407/IANA assignment */
#define SADB_X_AALG_SHA2_256 5
#define SADB_X_AALG_SHA2_384 6
@@ -311,6 +312,7 @@ struct sadb_x_ipsecrequest {
#define SADB_X_AALG_MD5 249 /* Keyed MD5 */
#define SADB_X_AALG_SHA 250 /* Keyed SHA */
#define SADB_X_AALG_NULL 251 /* null authentication */
+#define SADB_X_AALG_TCP_MD5 252 /* Keyed TCP-MD5 (RFC2385) */
/* RFC2367 numbers - meets RFC2407 */
#define SADB_EALG_NONE 0
OpenPOWER on IntegriCloud