summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regress/sbin/ipsecctl/Makefile42
-rw-r--r--regress/sbin/ipsecctl/ipsec1.in1
-rw-r--r--regress/sbin/ipsecctl/ipsec1.ok4
-rw-r--r--regress/sbin/ipsecctl/ipsec10.in3
-rw-r--r--regress/sbin/ipsecctl/ipsec10.ok8
-rw-r--r--regress/sbin/ipsecctl/ipsec11.in3
-rw-r--r--regress/sbin/ipsecctl/ipsec11.ok8
-rw-r--r--regress/sbin/ipsecctl/ipsec12.in6
-rw-r--r--regress/sbin/ipsecctl/ipsec12.ok8
-rw-r--r--regress/sbin/ipsecctl/ipsec2.in1
-rw-r--r--regress/sbin/ipsecctl/ipsec2.ok8
-rw-r--r--regress/sbin/ipsecctl/ipsec3.in1
-rw-r--r--regress/sbin/ipsecctl/ipsec3.ok4
-rw-r--r--regress/sbin/ipsecctl/ipsec4.in3
-rw-r--r--regress/sbin/ipsecctl/ipsec4.ok8
-rw-r--r--regress/sbin/ipsecctl/ipsec5.in3
-rw-r--r--regress/sbin/ipsecctl/ipsec5.ok8
-rw-r--r--regress/sbin/ipsecctl/ipsec6.in6
-rw-r--r--regress/sbin/ipsecctl/ipsec6.ok8
-rw-r--r--regress/sbin/ipsecctl/ipsec7.in1
-rw-r--r--regress/sbin/ipsecctl/ipsec7.ok4
-rw-r--r--regress/sbin/ipsecctl/ipsec8.in1
-rw-r--r--regress/sbin/ipsecctl/ipsec8.ok8
-rw-r--r--regress/sbin/ipsecctl/ipsec9.in1
-rw-r--r--regress/sbin/ipsecctl/ipsec9.ok4
-rw-r--r--regress/sbin/ipsecctl/tcpmd51.in1
-rw-r--r--regress/sbin/ipsecctl/tcpmd51.ok4
-rw-r--r--regress/sbin/ipsecctl/tcpmd52.in2
-rw-r--r--regress/sbin/ipsecctl/tcpmd52.ok4
29 files changed, 163 insertions, 0 deletions
diff --git a/regress/sbin/ipsecctl/Makefile b/regress/sbin/ipsecctl/Makefile
new file mode 100644
index 00000000000..f5f5294fd1e
--- /dev/null
+++ b/regress/sbin/ipsecctl/Makefile
@@ -0,0 +1,42 @@
+# $OpenBSD: Makefile,v 1.1 2005/08/05 09:18:26 hshoexer Exp $
+
+# TARGETS
+# ipsec: feed ipsecNN.in through ipsecctl and check wether the output matches
+# ipsecNN.ok
+# tcpmd5: same as above, but for tcpmd5 rules
+
+IPSECTESTS=1 2 3 4 5 6 7 8 9 10 11 12
+TCPMD5TESTS=1 2
+
+SHELL=/bin/sh
+
+.MAIN: all
+
+.for n in ${IPSECTESTS}
+IPSEC_TARGETS+=ipsec${n}
+
+ipsec${n}:
+ ipsecctl -nv -f - < ${.CURDIR}/ipsec${n}.in | \
+ diff -u ${.CURDIR}/ipsec${n}.ok /dev/stdin
+
+.endfor
+
+.for n in ${TCPMD5TESTS}
+TCPMD5_TARGETS+=tcpmd5${n}
+
+tcpmd5${n}:
+ ipsecctl -nv -f - < ${.CURDIR}/tcpmd5${n}.in | \
+ diff -u ${.CURDIR}/tcpmd5${n}.ok /dev/stdin
+.endfor
+
+ipsec: ${IPSEC_TARGETS}
+REGRESS_TARGETS+=ipsec
+
+tcpmd5: ${TCPMD5_TARGETS}
+REGRESS_TARGETS+=tcpmd5
+
+alltests: ${REGRESS_TARGETS}
+
+.PHONY: ${REGRESS_TARGETS}
+
+.include <bsd.regress.mk>
diff --git a/regress/sbin/ipsecctl/ipsec1.in b/regress/sbin/ipsecctl/ipsec1.in
new file mode 100644
index 00000000000..0c75d0177db
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec1.in
@@ -0,0 +1 @@
+flow esp from 1.1.1.1 to 2.2.2.2
diff --git a/regress/sbin/ipsecctl/ipsec1.ok b/regress/sbin/ipsecctl/ipsec1.ok
new file mode 100644
index 00000000000..42ba91174b5
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec1.ok
@@ -0,0 +1,4 @@
+flow esp out from 1.1.1.1 to 2.2.2.2 peer 2.2.2.2
+ type require
+flow esp in from 2.2.2.2 to 1.1.1.1 peer 2.2.2.2
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec10.in b/regress/sbin/ipsecctl/ipsec10.in
new file mode 100644
index 00000000000..b0e4ec66ad2
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec10.in
@@ -0,0 +1,3 @@
+flow ah from 1.1.1.1 to 3.3.3.0/24 peer 2.2.2.2 \
+ srcid host1.one.net \
+ dstid host2.two.net
diff --git a/regress/sbin/ipsecctl/ipsec10.ok b/regress/sbin/ipsecctl/ipsec10.ok
new file mode 100644
index 00000000000..6a3545a72da
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec10.ok
@@ -0,0 +1,8 @@
+flow ah out from 1.1.1.1 to 3.3.3.0/24 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type require
+flow ah in from 3.3.3.0/24 to 1.1.1.1 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec11.in b/regress/sbin/ipsecctl/ipsec11.in
new file mode 100644
index 00000000000..a8ecab56c84
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec11.in
@@ -0,0 +1,3 @@
+flow ah from 4.4.0.0/16 to 3.3.3.0/24 peer 2.2.2.2 \
+ srcid host1.one.net \
+ dstid host2.two.net
diff --git a/regress/sbin/ipsecctl/ipsec11.ok b/regress/sbin/ipsecctl/ipsec11.ok
new file mode 100644
index 00000000000..189b5a87cf4
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec11.ok
@@ -0,0 +1,8 @@
+flow ah out from 4.4.0.0/16 to 3.3.3.0/24 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type require
+flow ah in from 3.3.3.0/24 to 4.4.0.0/16 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec12.in b/regress/sbin/ipsecctl/ipsec12.in
new file mode 100644
index 00000000000..09fd8974ba9
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec12.in
@@ -0,0 +1,6 @@
+flow ah out from 4.4.0.0/16 to 3.3.3.0/24 peer 2.2.2.2 \
+ srcid host1.one.net \
+ dstid host2.two.net
+flow ah in from 3.3.3.0/24 to 4.4.0.0/16 peer 2.2.2.2 \
+ srcid host1.one.net \
+ dstid host2.two.net
diff --git a/regress/sbin/ipsecctl/ipsec12.ok b/regress/sbin/ipsecctl/ipsec12.ok
new file mode 100644
index 00000000000..189b5a87cf4
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec12.ok
@@ -0,0 +1,8 @@
+flow ah out from 4.4.0.0/16 to 3.3.3.0/24 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type require
+flow ah in from 3.3.3.0/24 to 4.4.0.0/16 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec2.in b/regress/sbin/ipsecctl/ipsec2.in
new file mode 100644
index 00000000000..81893d38b5f
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec2.in
@@ -0,0 +1 @@
+flow esp from 1.1.1.1 to 2.2.2.2 srcid host1.one.net dstid host2.two.net
diff --git a/regress/sbin/ipsecctl/ipsec2.ok b/regress/sbin/ipsecctl/ipsec2.ok
new file mode 100644
index 00000000000..436fbea9e29
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec2.ok
@@ -0,0 +1,8 @@
+flow esp out from 1.1.1.1 to 2.2.2.2 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type require
+flow esp in from 2.2.2.2 to 1.1.1.1 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec3.in b/regress/sbin/ipsecctl/ipsec3.in
new file mode 100644
index 00000000000..1e0bbcb27ee
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec3.in
@@ -0,0 +1 @@
+flow esp from 1.1.1.1 to 3.3.3.0/24 peer 2.2.2.2
diff --git a/regress/sbin/ipsecctl/ipsec3.ok b/regress/sbin/ipsecctl/ipsec3.ok
new file mode 100644
index 00000000000..a82868434e5
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec3.ok
@@ -0,0 +1,4 @@
+flow esp out from 1.1.1.1 to 3.3.3.0/24 peer 2.2.2.2
+ type require
+flow esp in from 3.3.3.0/24 to 1.1.1.1 peer 2.2.2.2
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec4.in b/regress/sbin/ipsecctl/ipsec4.in
new file mode 100644
index 00000000000..355cdd7066b
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec4.in
@@ -0,0 +1,3 @@
+flow esp from 1.1.1.1 to 3.3.3.0/24 peer 2.2.2.2 \
+ srcid host1.one.net \
+ dstid host2.two.net
diff --git a/regress/sbin/ipsecctl/ipsec4.ok b/regress/sbin/ipsecctl/ipsec4.ok
new file mode 100644
index 00000000000..d6ff3d0366c
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec4.ok
@@ -0,0 +1,8 @@
+flow esp out from 1.1.1.1 to 3.3.3.0/24 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type require
+flow esp in from 3.3.3.0/24 to 1.1.1.1 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec5.in b/regress/sbin/ipsecctl/ipsec5.in
new file mode 100644
index 00000000000..a67fe4e5a00
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec5.in
@@ -0,0 +1,3 @@
+flow esp from 4.4.0.0/16 to 3.3.3.0/24 peer 2.2.2.2 \
+ srcid host1.one.net \
+ dstid host2.two.net
diff --git a/regress/sbin/ipsecctl/ipsec5.ok b/regress/sbin/ipsecctl/ipsec5.ok
new file mode 100644
index 00000000000..ab61ea1a0f2
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec5.ok
@@ -0,0 +1,8 @@
+flow esp out from 4.4.0.0/16 to 3.3.3.0/24 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type require
+flow esp in from 3.3.3.0/24 to 4.4.0.0/16 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec6.in b/regress/sbin/ipsecctl/ipsec6.in
new file mode 100644
index 00000000000..1c78a51984e
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec6.in
@@ -0,0 +1,6 @@
+flow esp out from 4.4.0.0/16 to 3.3.3.0/24 peer 2.2.2.2 \
+ srcid host1.one.net \
+ dstid host2.two.net
+flow esp in from 3.3.3.0/24 to 4.4.0.0/16 peer 2.2.2.2 \
+ srcid host1.one.net \
+ dstid host2.two.net
diff --git a/regress/sbin/ipsecctl/ipsec6.ok b/regress/sbin/ipsecctl/ipsec6.ok
new file mode 100644
index 00000000000..ab61ea1a0f2
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec6.ok
@@ -0,0 +1,8 @@
+flow esp out from 4.4.0.0/16 to 3.3.3.0/24 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type require
+flow esp in from 3.3.3.0/24 to 4.4.0.0/16 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec7.in b/regress/sbin/ipsecctl/ipsec7.in
new file mode 100644
index 00000000000..dcb50386602
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec7.in
@@ -0,0 +1 @@
+flow ah from 1.1.1.1 to 2.2.2.2
diff --git a/regress/sbin/ipsecctl/ipsec7.ok b/regress/sbin/ipsecctl/ipsec7.ok
new file mode 100644
index 00000000000..2e9aae9e319
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec7.ok
@@ -0,0 +1,4 @@
+flow ah out from 1.1.1.1 to 2.2.2.2 peer 2.2.2.2
+ type require
+flow ah in from 2.2.2.2 to 1.1.1.1 peer 2.2.2.2
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec8.in b/regress/sbin/ipsecctl/ipsec8.in
new file mode 100644
index 00000000000..5de51b8abda
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec8.in
@@ -0,0 +1 @@
+flow ah from 1.1.1.1 to 2.2.2.2 srcid host1.one.net dstid host2.two.net
diff --git a/regress/sbin/ipsecctl/ipsec8.ok b/regress/sbin/ipsecctl/ipsec8.ok
new file mode 100644
index 00000000000..1bef6b4c4d1
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec8.ok
@@ -0,0 +1,8 @@
+flow ah out from 1.1.1.1 to 2.2.2.2 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type require
+flow ah in from 2.2.2.2 to 1.1.1.1 peer 2.2.2.2
+ srcid host1.one.net
+ dstid host2.two.net
+ type use
diff --git a/regress/sbin/ipsecctl/ipsec9.in b/regress/sbin/ipsecctl/ipsec9.in
new file mode 100644
index 00000000000..b24efe705dc
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec9.in
@@ -0,0 +1 @@
+flow ah from 1.1.1.1 to 3.3.3.0/24 peer 2.2.2.2
diff --git a/regress/sbin/ipsecctl/ipsec9.ok b/regress/sbin/ipsecctl/ipsec9.ok
new file mode 100644
index 00000000000..7fd2751ec3f
--- /dev/null
+++ b/regress/sbin/ipsecctl/ipsec9.ok
@@ -0,0 +1,4 @@
+flow ah out from 1.1.1.1 to 3.3.3.0/24 peer 2.2.2.2
+ type require
+flow ah in from 3.3.3.0/24 to 1.1.1.1 peer 2.2.2.2
+ type use
diff --git a/regress/sbin/ipsecctl/tcpmd51.in b/regress/sbin/ipsecctl/tcpmd51.in
new file mode 100644
index 00000000000..035f2a71ad2
--- /dev/null
+++ b/regress/sbin/ipsecctl/tcpmd51.in
@@ -0,0 +1 @@
+tcpmd5 from 1.1.1.1 to 2.2.2.2 spi 0x2000:0x2001 authkey 0xdeadbeef:0xbeefdead
diff --git a/regress/sbin/ipsecctl/tcpmd51.ok b/regress/sbin/ipsecctl/tcpmd51.ok
new file mode 100644
index 00000000000..a8cbe06742e
--- /dev/null
+++ b/regress/sbin/ipsecctl/tcpmd51.ok
@@ -0,0 +1,4 @@
+tcpmd5 from 1.1.1.1 to 2.2.2.2 spi 0x00002000
+ key 0xdeadbeef
+tcpmd5 from 2.2.2.2 to 1.1.1.1 spi 0x00002001
+ key 0xbeefdead
diff --git a/regress/sbin/ipsecctl/tcpmd52.in b/regress/sbin/ipsecctl/tcpmd52.in
new file mode 100644
index 00000000000..7f5ef95a982
--- /dev/null
+++ b/regress/sbin/ipsecctl/tcpmd52.in
@@ -0,0 +1,2 @@
+tcpmd5 from 1.1.1.1 to 2.2.2.2 spi 0x1000 authkey 0xdeadbeef
+tcpmd5 from 1.1.1.1 to 2.2.2.2 spi 0x1001 authkey 0xbeefdead
diff --git a/regress/sbin/ipsecctl/tcpmd52.ok b/regress/sbin/ipsecctl/tcpmd52.ok
new file mode 100644
index 00000000000..0bb38b72ea8
--- /dev/null
+++ b/regress/sbin/ipsecctl/tcpmd52.ok
@@ -0,0 +1,4 @@
+tcpmd5 from 1.1.1.1 to 2.2.2.2 spi 0x00001000
+ key 0xdeadbeef
+tcpmd5 from 1.1.1.1 to 2.2.2.2 spi 0x00001001
+ key 0xbeefdead