added two-certs scenario
authorAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 15 May 2007 15:54:06 +0000 (15:54 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 15 May 2007 15:54:06 +0000 (15:54 -0000)
testing/tests/ikev2/two-certs/description.txt [new file with mode: 0644]
testing/tests/ikev2/two-certs/evaltest.dat [new file with mode: 0644]
testing/tests/ikev2/two-certs/hosts/carol/etc/ipsec.conf [new file with mode: 0755]
testing/tests/ikev2/two-certs/hosts/dave/etc/ipsec.conf [new file with mode: 0755]
testing/tests/ikev2/two-certs/hosts/moon/etc/ipsec.conf [new file with mode: 0755]
testing/tests/ikev2/two-certs/hosts/moon/etc/ipsec.d/certs/carolRevokedCert.pem [new file with mode: 0644]
testing/tests/ikev2/two-certs/hosts/moon/etc/ipsec.d/certs/daveCert.der [new file with mode: 0644]
testing/tests/ikev2/two-certs/posttest.dat [new file with mode: 0644]
testing/tests/ikev2/two-certs/pretest.dat [new file with mode: 0644]
testing/tests/ikev2/two-certs/test.conf [new file with mode: 0644]

diff --git a/testing/tests/ikev2/two-certs/description.txt b/testing/tests/ikev2/two-certs/description.txt
new file mode 100644 (file)
index 0000000..46ca8fe
--- /dev/null
@@ -0,0 +1,6 @@
+The roadwarriors <b>carol</b> and <b>dave</b> set up a connection each 
+to gateway <b>moon</b>. The authentication is based on <b>X.509 certificates</b>.
+Gateway <b>moon</b> has already loaded a revoked certificate for <b>carol</b>
+and a self-signed certificate for <b>dave</b> locally but gets actual certificates
+as CERT payloads from both peers. The RSA signature verification process tries all
+candidate peer certificates until it finds a valid one with a matching public key.
diff --git a/testing/tests/ikev2/two-certs/evaltest.dat b/testing/tests/ikev2/two-certs/evaltest.dat
new file mode 100644 (file)
index 0000000..3421c6e
--- /dev/null
@@ -0,0 +1,14 @@
+moon::cat /var/log/daemon.log::candidate peer certificate was not successfully verified::YES
+moon::cat /var/log/daemon.log::candidate peer certificate has a non-matching RSA public key::YES
+moon::cat /var/log/daemon.log::candidate peer certificate has a matching RSA public key::YES
+moon::ipsec statusall::carol.*ESTABLISHED::YES
+moon::ipsec statusall::dave.*ESTABLISHED::YES
+carol::ipsec statusall::home.*ESTABLISHED::YES
+dave::ipsec statusall::home.*ESTABLISHED::YES
+carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
+dave::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
+moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
+moon::tcpdump::IP moon.strongswan.org > carol.strongswan.org: ESP::YES
+moon::tcpdump::IP dave.strongswan.org > moon.strongswan.org: ESP::YES
+moon::tcpdump::IP moon.strongswan.org > dave.strongswan.org: ESP::YES
+
diff --git a/testing/tests/ikev2/two-certs/hosts/carol/etc/ipsec.conf b/testing/tests/ikev2/two-certs/hosts/carol/etc/ipsec.conf
new file mode 100755 (executable)
index 0000000..e5d9ad4
--- /dev/null
@@ -0,0 +1,24 @@
+# /etc/ipsec.conf - strongSwan IPsec configuration file
+
+config setup
+        crlcheckinterval=180
+       strictcrlpolicy=no
+       plutostart=no
+
+conn %default
+       ikelifetime=60m
+       keylife=20m
+       rekeymargin=3m
+       keyingtries=1
+
+conn home
+       left=PH_IP_CAROL
+       leftnexthop=%direct
+       leftcert=carolCert.pem
+       leftid=carol@strongswan.org
+       leftfirewall=yes
+       right=PH_IP_MOON
+       rightid=@moon.strongswan.org
+       rightsubnet=10.1.0.0/16
+       keyexchange=ikev2
+       auto=add
diff --git a/testing/tests/ikev2/two-certs/hosts/dave/etc/ipsec.conf b/testing/tests/ikev2/two-certs/hosts/dave/etc/ipsec.conf
new file mode 100755 (executable)
index 0000000..3c00149
--- /dev/null
@@ -0,0 +1,24 @@
+# /etc/ipsec.conf - strongSwan IPsec configuration file
+
+config setup
+        crlcheckinterval=180
+       strictcrlpolicy=no
+       plutostart=no
+
+conn %default
+       ikelifetime=60m
+       keylife=20m
+       rekeymargin=3m
+       keyingtries=1
+
+conn home
+       left=PH_IP_DAVE
+       leftnexthop=%direct
+       leftcert=daveCert.pem
+       leftid=dave@strongswan.org
+       leftfirewall=yes
+       right=PH_IP_MOON
+       rightid=@moon.strongswan.org
+       rightsubnet=10.1.0.0/16
+       keyexchange=ikev2
+       auto=add
diff --git a/testing/tests/ikev2/two-certs/hosts/moon/etc/ipsec.conf b/testing/tests/ikev2/two-certs/hosts/moon/etc/ipsec.conf
new file mode 100755 (executable)
index 0000000..6955ce7
--- /dev/null
@@ -0,0 +1,32 @@
+# /etc/ipsec.conf - strongSwan IPsec configuration file
+
+config setup
+       charondebug="cfg 2"
+        crlcheckinterval=180
+       strictcrlpolicy=yes
+       plutostart=no
+
+conn %default
+       ikelifetime=60m
+       keylife=20m
+       rekeymargin=3m
+       keyingtries=1
+       left=PH_IP_MOON
+       leftnexthop=%direct
+       leftcert=moonCert.pem
+       leftid=@moon.strongswan.org
+       leftsubnet=10.1.0.0/16
+       leftfirewall=yes
+       right=%any
+       keyexchange=ikev2
+
+conn carol
+       rightid=carol@strongswan.org
+       rightcert=carolRevokedCert.pem
+       auto=add
+
+conn dave
+       rightid=dave@strongswan.org
+       rightcert=daveCert.der
+       auto=add
+
diff --git a/testing/tests/ikev2/two-certs/hosts/moon/etc/ipsec.d/certs/carolRevokedCert.pem b/testing/tests/ikev2/two-certs/hosts/moon/etc/ipsec.d/certs/carolRevokedCert.pem
new file mode 100644 (file)
index 0000000..5b742fc
--- /dev/null
@@ -0,0 +1,25 @@
+-----BEGIN CERTIFICATE-----
+MIIEIjCCAwqgAwIBAgIBBzANBgkqhkiG9w0BAQQFADBFMQswCQYDVQQGEwJDSDEZ
+MBcGA1UEChMQTGludXggc3Ryb25nU3dhbjEbMBkGA1UEAxMSc3Ryb25nU3dhbiBS
+b290IENBMB4XDTA0MDkxMDExMjU0OFoXDTA5MDkwOTExMjU0OFowWjELMAkGA1UE
+BhMCQ0gxGTAXBgNVBAoTEExpbnV4IHN0cm9uZ1N3YW4xETA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ztMLQYPzqTpuMvC5p4JzL
+LWGWhKRhJs53NmxXXodck/ZgaqiTWuQFYlbamJRvzVBfX7c1SWHRJvxSSOPKGIg3
+wphkO2naj/SQD+BNuWTRmZ9YCiLOQ64ybLpJzRZISETdqtLBPKsIqosUZwkxlR1N
+9IcgYi5x
+-----END CERTIFICATE-----
diff --git a/testing/tests/ikev2/two-certs/hosts/moon/etc/ipsec.d/certs/daveCert.der b/testing/tests/ikev2/two-certs/hosts/moon/etc/ipsec.d/certs/daveCert.der
new file mode 100644 (file)
index 0000000..6c4f37c
Binary files /dev/null and b/testing/tests/ikev2/two-certs/hosts/moon/etc/ipsec.d/certs/daveCert.der differ
diff --git a/testing/tests/ikev2/two-certs/posttest.dat b/testing/tests/ikev2/two-certs/posttest.dat
new file mode 100644 (file)
index 0000000..195065a
--- /dev/null
@@ -0,0 +1,7 @@
+moon::ipsec stop
+carol::ipsec stop
+dave::ipsec stop
+moon::/etc/init.d/iptables stop 2> /dev/null
+carol::/etc/init.d/iptables stop 2> /dev/null
+dave::/etc/init.d/iptables stop 2> /dev/null
+moon::rm /etc/ipsec.d/certs/*
diff --git a/testing/tests/ikev2/two-certs/pretest.dat b/testing/tests/ikev2/two-certs/pretest.dat
new file mode 100644 (file)
index 0000000..42e9d7c
--- /dev/null
@@ -0,0 +1,9 @@
+moon::/etc/init.d/iptables start 2> /dev/null
+carol::/etc/init.d/iptables start 2> /dev/null
+dave::/etc/init.d/iptables start 2> /dev/null
+moon::ipsec start
+carol::ipsec start
+dave::ipsec start
+carol::sleep 1
+carol::ipsec up home
+dave::ipsec up home
diff --git a/testing/tests/ikev2/two-certs/test.conf b/testing/tests/ikev2/two-certs/test.conf
new file mode 100644 (file)
index 0000000..7041682
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# This configuration file provides information on the
+# UML instances used for this test
+
+# All UML instances that are required for this test
+#
+UMLHOSTS="alice moon carol winnetou dave"
+
+# Corresponding block diagram
+#
+DIAGRAM="a-m-c-w-d.png"
+
+# UML instances on which tcpdump is to be started
+#
+TCPDUMPHOSTS="moon"
+
+# UML instances on which IPsec is started
+# Used for IPsec logging purposes
+#
+IPSECHOSTS="moon carol dave"