From 10e5fb2b9b2f27c83b3e5a1d048b158d5cf42a43 Mon Sep 17 00:00:00 2001 From: Yves-Alexis Perez Date: Fri, 26 Apr 2013 14:57:47 +0200 Subject: Imported Upstream version 5.0.3 --- .../tests/tkm/host2host-initiator/description.txt | 3 ++ testing/tests/tkm/host2host-initiator/evaltest.dat | 12 +++++++ .../hosts/moon/etc/tkm/moonKey.der | Bin 0 -> 1191 bytes .../hosts/moon/etc/tkm/strongswanCert.der | Bin 0 -> 956 bytes .../hosts/moon/etc/tkm/tkm.conf | 21 ++++++++++++ .../host2host-initiator/hosts/sun/etc/ipsec.conf | 20 ++++++++++++ .../hosts/sun/etc/strongswan.conf | 5 +++ testing/tests/tkm/host2host-initiator/posttest.dat | 4 +++ testing/tests/tkm/host2host-initiator/pretest.dat | 10 ++++++ testing/tests/tkm/host2host-initiator/test.conf | 21 ++++++++++++ .../tests/tkm/host2host-responder/description.txt | 3 ++ testing/tests/tkm/host2host-responder/evaltest.dat | 12 +++++++ .../hosts/moon/etc/tkm/moonKey.der | Bin 0 -> 1191 bytes .../hosts/moon/etc/tkm/strongswanCert.der | Bin 0 -> 956 bytes .../hosts/moon/etc/tkm/tkm.conf | 21 ++++++++++++ .../host2host-responder/hosts/sun/etc/ipsec.conf | 21 ++++++++++++ .../hosts/sun/etc/strongswan.conf | 5 +++ testing/tests/tkm/host2host-responder/posttest.dat | 4 +++ testing/tests/tkm/host2host-responder/pretest.dat | 10 ++++++ testing/tests/tkm/host2host-responder/test.conf | 21 ++++++++++++ .../tests/tkm/host2host-xfrmproxy/description.txt | 5 +++ testing/tests/tkm/host2host-xfrmproxy/evaltest.dat | 13 ++++++++ .../hosts/moon/etc/tkm/moonKey.der | Bin 0 -> 1191 bytes .../hosts/moon/etc/tkm/strongswanCert.der | Bin 0 -> 956 bytes .../hosts/moon/etc/tkm/tkm.conf | 21 ++++++++++++ .../host2host-xfrmproxy/hosts/sun/etc/ipsec.conf | 20 ++++++++++++ .../hosts/sun/etc/strongswan.conf | 5 +++ testing/tests/tkm/host2host-xfrmproxy/posttest.dat | 5 +++ testing/tests/tkm/host2host-xfrmproxy/pretest.dat | 12 +++++++ testing/tests/tkm/host2host-xfrmproxy/test.conf | 21 ++++++++++++ testing/tests/tkm/multiple-clients/description.txt | 5 +++ testing/tests/tkm/multiple-clients/evaltest.dat | 23 +++++++++++++ .../multiple-clients/hosts/carol/etc/ipsec.conf | 22 +++++++++++++ .../hosts/carol/etc/strongswan.conf | 5 +++ .../tkm/multiple-clients/hosts/dave/etc/ipsec.conf | 22 +++++++++++++ .../hosts/dave/etc/strongswan.conf | 5 +++ .../hosts/sun/etc/tkm/strongswanCert.der | Bin 0 -> 956 bytes .../multiple-clients/hosts/sun/etc/tkm/sunKey.der | Bin 0 -> 1192 bytes .../multiple-clients/hosts/sun/etc/tkm/tkm.conf | 36 +++++++++++++++++++++ testing/tests/tkm/multiple-clients/posttest.dat | 5 +++ testing/tests/tkm/multiple-clients/pretest.dat | 14 ++++++++ testing/tests/tkm/multiple-clients/test.conf | 21 ++++++++++++ .../tests/tkm/net2net-initiator/description.txt | 5 +++ testing/tests/tkm/net2net-initiator/evaltest.dat | 12 +++++++ .../hosts/moon/etc/tkm/moonKey.der | Bin 0 -> 1191 bytes .../net2net-initiator/hosts/moon/etc/tkm/tkm.conf | 23 +++++++++++++ .../tkm/net2net-initiator/hosts/sun/etc/ipsec.conf | 23 +++++++++++++ .../hosts/sun/etc/strongswan.conf | 6 ++++ testing/tests/tkm/net2net-initiator/posttest.dat | 4 +++ testing/tests/tkm/net2net-initiator/pretest.dat | 10 ++++++ testing/tests/tkm/net2net-initiator/test.conf | 21 ++++++++++++ .../tests/tkm/net2net-xfrmproxy/description.txt | 6 ++++ testing/tests/tkm/net2net-xfrmproxy/evaltest.dat | 13 ++++++++ .../hosts/moon/etc/tkm/moonKey.der | Bin 0 -> 1191 bytes .../hosts/moon/etc/tkm/strongswanCert.der | Bin 0 -> 956 bytes .../net2net-xfrmproxy/hosts/moon/etc/tkm/tkm.conf | 23 +++++++++++++ .../tkm/net2net-xfrmproxy/hosts/sun/etc/ipsec.conf | 23 +++++++++++++ .../hosts/sun/etc/strongswan.conf | 6 ++++ testing/tests/tkm/net2net-xfrmproxy/posttest.dat | 4 +++ testing/tests/tkm/net2net-xfrmproxy/pretest.dat | 12 +++++++ testing/tests/tkm/net2net-xfrmproxy/test.conf | 21 ++++++++++++ 61 files changed, 665 insertions(+) create mode 100644 testing/tests/tkm/host2host-initiator/description.txt create mode 100644 testing/tests/tkm/host2host-initiator/evaltest.dat create mode 100644 testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/moonKey.der create mode 100644 testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/strongswanCert.der create mode 100644 testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/tkm.conf create mode 100644 testing/tests/tkm/host2host-initiator/hosts/sun/etc/ipsec.conf create mode 100644 testing/tests/tkm/host2host-initiator/hosts/sun/etc/strongswan.conf create mode 100644 testing/tests/tkm/host2host-initiator/posttest.dat create mode 100644 testing/tests/tkm/host2host-initiator/pretest.dat create mode 100644 testing/tests/tkm/host2host-initiator/test.conf create mode 100644 testing/tests/tkm/host2host-responder/description.txt create mode 100644 testing/tests/tkm/host2host-responder/evaltest.dat create mode 100644 testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/moonKey.der create mode 100644 testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/strongswanCert.der create mode 100644 testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/tkm.conf create mode 100644 testing/tests/tkm/host2host-responder/hosts/sun/etc/ipsec.conf create mode 100644 testing/tests/tkm/host2host-responder/hosts/sun/etc/strongswan.conf create mode 100644 testing/tests/tkm/host2host-responder/posttest.dat create mode 100644 testing/tests/tkm/host2host-responder/pretest.dat create mode 100644 testing/tests/tkm/host2host-responder/test.conf create mode 100644 testing/tests/tkm/host2host-xfrmproxy/description.txt create mode 100644 testing/tests/tkm/host2host-xfrmproxy/evaltest.dat create mode 100644 testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/moonKey.der create mode 100644 testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/strongswanCert.der create mode 100644 testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/tkm.conf create mode 100644 testing/tests/tkm/host2host-xfrmproxy/hosts/sun/etc/ipsec.conf create mode 100644 testing/tests/tkm/host2host-xfrmproxy/hosts/sun/etc/strongswan.conf create mode 100644 testing/tests/tkm/host2host-xfrmproxy/posttest.dat create mode 100644 testing/tests/tkm/host2host-xfrmproxy/pretest.dat create mode 100644 testing/tests/tkm/host2host-xfrmproxy/test.conf create mode 100644 testing/tests/tkm/multiple-clients/description.txt create mode 100644 testing/tests/tkm/multiple-clients/evaltest.dat create mode 100644 testing/tests/tkm/multiple-clients/hosts/carol/etc/ipsec.conf create mode 100644 testing/tests/tkm/multiple-clients/hosts/carol/etc/strongswan.conf create mode 100644 testing/tests/tkm/multiple-clients/hosts/dave/etc/ipsec.conf create mode 100644 testing/tests/tkm/multiple-clients/hosts/dave/etc/strongswan.conf create mode 100644 testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/strongswanCert.der create mode 100644 testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/sunKey.der create mode 100644 testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/tkm.conf create mode 100644 testing/tests/tkm/multiple-clients/posttest.dat create mode 100644 testing/tests/tkm/multiple-clients/pretest.dat create mode 100644 testing/tests/tkm/multiple-clients/test.conf create mode 100644 testing/tests/tkm/net2net-initiator/description.txt create mode 100644 testing/tests/tkm/net2net-initiator/evaltest.dat create mode 100644 testing/tests/tkm/net2net-initiator/hosts/moon/etc/tkm/moonKey.der create mode 100644 testing/tests/tkm/net2net-initiator/hosts/moon/etc/tkm/tkm.conf create mode 100644 testing/tests/tkm/net2net-initiator/hosts/sun/etc/ipsec.conf create mode 100644 testing/tests/tkm/net2net-initiator/hosts/sun/etc/strongswan.conf create mode 100644 testing/tests/tkm/net2net-initiator/posttest.dat create mode 100644 testing/tests/tkm/net2net-initiator/pretest.dat create mode 100644 testing/tests/tkm/net2net-initiator/test.conf create mode 100644 testing/tests/tkm/net2net-xfrmproxy/description.txt create mode 100644 testing/tests/tkm/net2net-xfrmproxy/evaltest.dat create mode 100644 testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/moonKey.der create mode 100644 testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/strongswanCert.der create mode 100644 testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/tkm.conf create mode 100644 testing/tests/tkm/net2net-xfrmproxy/hosts/sun/etc/ipsec.conf create mode 100644 testing/tests/tkm/net2net-xfrmproxy/hosts/sun/etc/strongswan.conf create mode 100644 testing/tests/tkm/net2net-xfrmproxy/posttest.dat create mode 100644 testing/tests/tkm/net2net-xfrmproxy/pretest.dat create mode 100644 testing/tests/tkm/net2net-xfrmproxy/test.conf (limited to 'testing/tests/tkm') diff --git a/testing/tests/tkm/host2host-initiator/description.txt b/testing/tests/tkm/host2host-initiator/description.txt new file mode 100644 index 000000000..467693b1e --- /dev/null +++ b/testing/tests/tkm/host2host-initiator/description.txt @@ -0,0 +1,3 @@ +A connection between the hosts moon and sun is set up. The host +moon uses the Trusted Key Manager (TKM) and is the initiator of the +transport connection. The authentication is based on X.509 certificates. diff --git a/testing/tests/tkm/host2host-initiator/evaltest.dat b/testing/tests/tkm/host2host-initiator/evaltest.dat new file mode 100644 index 000000000..d8d44dff6 --- /dev/null +++ b/testing/tests/tkm/host2host-initiator/evaltest.dat @@ -0,0 +1,12 @@ +moon::ipsec stroke status 2> /dev/null::conn1.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES +sun::ipsec status 2> /dev/null::host-host.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES +moon::ipsec stroke status 2> /dev/null::conn1.*INSTALLED, TRANSPORT::YES +sun::ipsec status 2> /dev/null::host-host.*INSTALLED, TRANSPORT::YES +moon::ping -c 1 PH_IP_SUN::64 bytes from PH_IP_SUN: icmp_req=1::YES +sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES +sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES +moon::cat /tmp/tkm.log::RSA private key '/etc/tkm/moonKey.der' loaded::YES +moon::cat /tmp/tkm.log::Adding policy \[ 1, 192.168.0.1 <-> 192.168.0.2 \]::YES +moon::cat /tmp/tkm.log::Checked CA certificate of CC context 1::YES +moon::cat /tmp/tkm.log::Authentication of ISA context 1 successful::YES +moon::cat /tmp/tkm.log::Adding SA \[ 1, 192.168.0.1 <-> 192.168.0.2, SPI_in.*, SPI_out.*, soft 30, hard 60 \]::YES diff --git a/testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/moonKey.der b/testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/moonKey.der new file mode 100644 index 000000000..97f0963f8 Binary files /dev/null and b/testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/moonKey.der differ diff --git a/testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/strongswanCert.der b/testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/strongswanCert.der new file mode 100644 index 000000000..a5a631f4b Binary files /dev/null and b/testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/strongswanCert.der differ diff --git a/testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/tkm.conf b/testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/tkm.conf new file mode 100644 index 000000000..2619c0089 --- /dev/null +++ b/testing/tests/tkm/host2host-initiator/hosts/moon/etc/tkm/tkm.conf @@ -0,0 +1,21 @@ + + + moon.strongswan.org + moonCert.pem + + + transport + + 1 + 192.168.0.1 + + + sun.strongswan.org + 192.168.0.2 + + + 30 + 60 + + + diff --git a/testing/tests/tkm/host2host-initiator/hosts/sun/etc/ipsec.conf b/testing/tests/tkm/host2host-initiator/hosts/sun/etc/ipsec.conf new file mode 100644 index 000000000..4ad0aa7db --- /dev/null +++ b/testing/tests/tkm/host2host-initiator/hosts/sun/etc/ipsec.conf @@ -0,0 +1,20 @@ +# /etc/ipsec.conf - strongSwan IPsec configuration file + +config setup + +conn %default + ikelifetime=60m + keylife=20m + rekeymargin=3m + keyingtries=1 + keyexchange=ikev2 + +conn host-host + left=PH_IP_SUN + leftcert=sunCert.pem + leftid=sun.strongswan.org + right=PH_IP_MOON + rightid=moon.strongswan.org + ike=aes256-sha512-modp4096! + esp=aes256-sha512-modp4096! + auto=add diff --git a/testing/tests/tkm/host2host-initiator/hosts/sun/etc/strongswan.conf b/testing/tests/tkm/host2host-initiator/hosts/sun/etc/strongswan.conf new file mode 100644 index 000000000..dc937641c --- /dev/null +++ b/testing/tests/tkm/host2host-initiator/hosts/sun/etc/strongswan.conf @@ -0,0 +1,5 @@ +# /etc/strongswan.conf - strongSwan configuration file + +charon { + load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 revocation hmac xcbc stroke kernel-netlink socket-default updown +} diff --git a/testing/tests/tkm/host2host-initiator/posttest.dat b/testing/tests/tkm/host2host-initiator/posttest.dat new file mode 100644 index 000000000..34037bc23 --- /dev/null +++ b/testing/tests/tkm/host2host-initiator/posttest.dat @@ -0,0 +1,4 @@ +moon::DAEMON_NAME=charon-tkm ipsec stop +moon::killall tkm_keymanager +moon::rm -f /tmp/tkm.rpc.ike /tmp/tkm.rpc.ees /tmp/tkm.log +sun::ipsec stop diff --git a/testing/tests/tkm/host2host-initiator/pretest.dat b/testing/tests/tkm/host2host-initiator/pretest.dat new file mode 100644 index 000000000..7cb90ac26 --- /dev/null +++ b/testing/tests/tkm/host2host-initiator/pretest.dat @@ -0,0 +1,10 @@ +moon::rm /etc/ipsec.secrets +moon::tkm_cfgtool -c /etc/tkm/tkm.conf -i /etc/ipsec.conf -t /etc/tkm/tkm.bin -s /usr/local/share/tkm/tkmconfig.xsd +moon::cat /etc/ipsec.conf +moon::tkm_keymanager -c /etc/tkm/tkm.bin -k /etc/tkm/moonKey.der -r /etc/tkm/strongswanCert.der >/tmp/tkm.log 2>&1 & +moon::expect-file /tmp/tkm.rpc.ike +moon::DAEMON_NAME=charon-tkm ipsec start +sun::ipsec start +sun::expect-connection host-host +moon::DAEMON_NAME=charon-tkm expect-connection conn1 +moon::DAEMON_NAME=charon-tkm ipsec up conn1 diff --git a/testing/tests/tkm/host2host-initiator/test.conf b/testing/tests/tkm/host2host-initiator/test.conf new file mode 100644 index 000000000..9647dc6a2 --- /dev/null +++ b/testing/tests/tkm/host2host-initiator/test.conf @@ -0,0 +1,21 @@ +#!/bin/bash +# +# This configuration file provides information on the +# guest instances used for this test + +# All guest instances that are required for this test +# +VIRTHOSTS="moon winnetou sun" + +# Corresponding block diagram +# +DIAGRAM="m-w-s.png" + +# Guest instances on which tcpdump is to be started +# +TCPDUMPHOSTS="sun" + +# Guest instances on which IPsec is started +# Used for IPsec logging purposes +# +IPSECHOSTS="moon sun" diff --git a/testing/tests/tkm/host2host-responder/description.txt b/testing/tests/tkm/host2host-responder/description.txt new file mode 100644 index 000000000..72eabdb6c --- /dev/null +++ b/testing/tests/tkm/host2host-responder/description.txt @@ -0,0 +1,3 @@ +A connection between the hosts moon and sun is set up. The host +moon uses the Trusted Key Manager (TKM) and is the responder of the +transport connection. The authentication is based on X.509 certificates. diff --git a/testing/tests/tkm/host2host-responder/evaltest.dat b/testing/tests/tkm/host2host-responder/evaltest.dat new file mode 100644 index 000000000..d8d44dff6 --- /dev/null +++ b/testing/tests/tkm/host2host-responder/evaltest.dat @@ -0,0 +1,12 @@ +moon::ipsec stroke status 2> /dev/null::conn1.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES +sun::ipsec status 2> /dev/null::host-host.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES +moon::ipsec stroke status 2> /dev/null::conn1.*INSTALLED, TRANSPORT::YES +sun::ipsec status 2> /dev/null::host-host.*INSTALLED, TRANSPORT::YES +moon::ping -c 1 PH_IP_SUN::64 bytes from PH_IP_SUN: icmp_req=1::YES +sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES +sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES +moon::cat /tmp/tkm.log::RSA private key '/etc/tkm/moonKey.der' loaded::YES +moon::cat /tmp/tkm.log::Adding policy \[ 1, 192.168.0.1 <-> 192.168.0.2 \]::YES +moon::cat /tmp/tkm.log::Checked CA certificate of CC context 1::YES +moon::cat /tmp/tkm.log::Authentication of ISA context 1 successful::YES +moon::cat /tmp/tkm.log::Adding SA \[ 1, 192.168.0.1 <-> 192.168.0.2, SPI_in.*, SPI_out.*, soft 30, hard 60 \]::YES diff --git a/testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/moonKey.der b/testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/moonKey.der new file mode 100644 index 000000000..97f0963f8 Binary files /dev/null and b/testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/moonKey.der differ diff --git a/testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/strongswanCert.der b/testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/strongswanCert.der new file mode 100644 index 000000000..a5a631f4b Binary files /dev/null and b/testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/strongswanCert.der differ diff --git a/testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/tkm.conf b/testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/tkm.conf new file mode 100644 index 000000000..2619c0089 --- /dev/null +++ b/testing/tests/tkm/host2host-responder/hosts/moon/etc/tkm/tkm.conf @@ -0,0 +1,21 @@ + + + moon.strongswan.org + moonCert.pem + + + transport + + 1 + 192.168.0.1 + + + sun.strongswan.org + 192.168.0.2 + + + 30 + 60 + + + diff --git a/testing/tests/tkm/host2host-responder/hosts/sun/etc/ipsec.conf b/testing/tests/tkm/host2host-responder/hosts/sun/etc/ipsec.conf new file mode 100644 index 000000000..6681dad11 --- /dev/null +++ b/testing/tests/tkm/host2host-responder/hosts/sun/etc/ipsec.conf @@ -0,0 +1,21 @@ +# /etc/ipsec.conf - strongSwan IPsec configuration file + +config setup + +conn %default + ikelifetime=60m + keylife=20m + rekeymargin=3m + keyingtries=1 + keyexchange=ikev2 + +conn host-host + left=PH_IP_SUN + leftcert=sunCert.pem + leftid=sun.strongswan.org + right=PH_IP_MOON + rightid=moon.strongswan.org + ike=aes256-sha512-modp4096! + esp=aes256-sha512-modp4096! + auto=add + type=transport diff --git a/testing/tests/tkm/host2host-responder/hosts/sun/etc/strongswan.conf b/testing/tests/tkm/host2host-responder/hosts/sun/etc/strongswan.conf new file mode 100644 index 000000000..dc937641c --- /dev/null +++ b/testing/tests/tkm/host2host-responder/hosts/sun/etc/strongswan.conf @@ -0,0 +1,5 @@ +# /etc/strongswan.conf - strongSwan configuration file + +charon { + load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 revocation hmac xcbc stroke kernel-netlink socket-default updown +} diff --git a/testing/tests/tkm/host2host-responder/posttest.dat b/testing/tests/tkm/host2host-responder/posttest.dat new file mode 100644 index 000000000..34037bc23 --- /dev/null +++ b/testing/tests/tkm/host2host-responder/posttest.dat @@ -0,0 +1,4 @@ +moon::DAEMON_NAME=charon-tkm ipsec stop +moon::killall tkm_keymanager +moon::rm -f /tmp/tkm.rpc.ike /tmp/tkm.rpc.ees /tmp/tkm.log +sun::ipsec stop diff --git a/testing/tests/tkm/host2host-responder/pretest.dat b/testing/tests/tkm/host2host-responder/pretest.dat new file mode 100644 index 000000000..40e84453f --- /dev/null +++ b/testing/tests/tkm/host2host-responder/pretest.dat @@ -0,0 +1,10 @@ +moon::rm /etc/ipsec.secrets +moon::tkm_cfgtool -c /etc/tkm/tkm.conf -i /etc/ipsec.conf -t /etc/tkm/tkm.bin -s /usr/local/share/tkm/tkmconfig.xsd +moon::cat /etc/ipsec.conf +moon::tkm_keymanager -c /etc/tkm/tkm.bin -k /etc/tkm/moonKey.der -r /etc/tkm/strongswanCert.der >/tmp/tkm.log 2>&1 & +moon::expect-file /tmp/tkm.rpc.ike +moon::DAEMON_NAME=charon-tkm ipsec start +sun::ipsec start +sun::expect-connection host-host +moon::DAEMON_NAME=charon-tkm expect-connection conn1 +sun::ipsec up host-host diff --git a/testing/tests/tkm/host2host-responder/test.conf b/testing/tests/tkm/host2host-responder/test.conf new file mode 100644 index 000000000..9647dc6a2 --- /dev/null +++ b/testing/tests/tkm/host2host-responder/test.conf @@ -0,0 +1,21 @@ +#!/bin/bash +# +# This configuration file provides information on the +# guest instances used for this test + +# All guest instances that are required for this test +# +VIRTHOSTS="moon winnetou sun" + +# Corresponding block diagram +# +DIAGRAM="m-w-s.png" + +# Guest instances on which tcpdump is to be started +# +TCPDUMPHOSTS="sun" + +# Guest instances on which IPsec is started +# Used for IPsec logging purposes +# +IPSECHOSTS="moon sun" diff --git a/testing/tests/tkm/host2host-xfrmproxy/description.txt b/testing/tests/tkm/host2host-xfrmproxy/description.txt new file mode 100644 index 000000000..b728a317d --- /dev/null +++ b/testing/tests/tkm/host2host-xfrmproxy/description.txt @@ -0,0 +1,5 @@ +A transport connection between the hosts moon and sun is set up. +The host moon starts the Trusted Key Manager (TKM) and the Ada XFRM +proxy, which relays XFRM kernel messages to charon. The authentication is based +on X.509 certificates. The connection is initiated by a ping from moon to +sun. diff --git a/testing/tests/tkm/host2host-xfrmproxy/evaltest.dat b/testing/tests/tkm/host2host-xfrmproxy/evaltest.dat new file mode 100644 index 000000000..7c8c6b24a --- /dev/null +++ b/testing/tests/tkm/host2host-xfrmproxy/evaltest.dat @@ -0,0 +1,13 @@ +moon::ipsec stroke status 2> /dev/null::conn1.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES +sun::ipsec status 2> /dev/null::host-host.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES +moon::ipsec stroke status 2> /dev/null::conn1.*INSTALLED, TRANSPORT::YES +sun::ipsec status 2> /dev/null::host-host.*INSTALLED, TRANSPORT::YES +moon::ping -c 1 PH_IP_SUN::64 bytes from PH_IP_SUN: icmp_req=1::YES +sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES +sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES +moon::cat /tmp/tkm.log::RSA private key '/etc/tkm/moonKey.der' loaded::YES +moon::cat /tmp/tkm.log::Adding policy \[ 1, 192.168.0.1 <-> 192.168.0.2 \]::YES +moon::cat /tmp/tkm.log::Checked CA certificate of CC context 1::YES +moon::cat /tmp/tkm.log::Authentication of ISA context 1 successful::YES +moon::cat /tmp/tkm.log::Adding SA \[ 1, 192.168.0.1 <-> 192.168.0.2, SPI_in.*, SPI_out.*, soft 30, hard 60 \]::YES +moon::cat /tmp/xfrm_proxy.log::Initiating ESA acquire for reqid 1::YES diff --git a/testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/moonKey.der b/testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/moonKey.der new file mode 100644 index 000000000..97f0963f8 Binary files /dev/null and b/testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/moonKey.der differ diff --git a/testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/strongswanCert.der b/testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/strongswanCert.der new file mode 100644 index 000000000..a5a631f4b Binary files /dev/null and b/testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/strongswanCert.der differ diff --git a/testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/tkm.conf b/testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/tkm.conf new file mode 100644 index 000000000..2619c0089 --- /dev/null +++ b/testing/tests/tkm/host2host-xfrmproxy/hosts/moon/etc/tkm/tkm.conf @@ -0,0 +1,21 @@ + + + moon.strongswan.org + moonCert.pem + + + transport + + 1 + 192.168.0.1 + + + sun.strongswan.org + 192.168.0.2 + + + 30 + 60 + + + diff --git a/testing/tests/tkm/host2host-xfrmproxy/hosts/sun/etc/ipsec.conf b/testing/tests/tkm/host2host-xfrmproxy/hosts/sun/etc/ipsec.conf new file mode 100644 index 000000000..4ad0aa7db --- /dev/null +++ b/testing/tests/tkm/host2host-xfrmproxy/hosts/sun/etc/ipsec.conf @@ -0,0 +1,20 @@ +# /etc/ipsec.conf - strongSwan IPsec configuration file + +config setup + +conn %default + ikelifetime=60m + keylife=20m + rekeymargin=3m + keyingtries=1 + keyexchange=ikev2 + +conn host-host + left=PH_IP_SUN + leftcert=sunCert.pem + leftid=sun.strongswan.org + right=PH_IP_MOON + rightid=moon.strongswan.org + ike=aes256-sha512-modp4096! + esp=aes256-sha512-modp4096! + auto=add diff --git a/testing/tests/tkm/host2host-xfrmproxy/hosts/sun/etc/strongswan.conf b/testing/tests/tkm/host2host-xfrmproxy/hosts/sun/etc/strongswan.conf new file mode 100644 index 000000000..dc937641c --- /dev/null +++ b/testing/tests/tkm/host2host-xfrmproxy/hosts/sun/etc/strongswan.conf @@ -0,0 +1,5 @@ +# /etc/strongswan.conf - strongSwan configuration file + +charon { + load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 revocation hmac xcbc stroke kernel-netlink socket-default updown +} diff --git a/testing/tests/tkm/host2host-xfrmproxy/posttest.dat b/testing/tests/tkm/host2host-xfrmproxy/posttest.dat new file mode 100644 index 000000000..99efe7b00 --- /dev/null +++ b/testing/tests/tkm/host2host-xfrmproxy/posttest.dat @@ -0,0 +1,5 @@ +moon::DAEMON_NAME=charon-tkm ipsec stop +moon::killall xfrm_proxy +moon::killall tkm_keymanager +moon::rm -f /tmp/tkm.rpc.ike /tmp/tkm.rpc.ees /tmp/tkm.log /tmp/xfrm_proxy.log +sun::ipsec stop diff --git a/testing/tests/tkm/host2host-xfrmproxy/pretest.dat b/testing/tests/tkm/host2host-xfrmproxy/pretest.dat new file mode 100644 index 000000000..d645ddbfe --- /dev/null +++ b/testing/tests/tkm/host2host-xfrmproxy/pretest.dat @@ -0,0 +1,12 @@ +sun::ipsec start +moon::rm /etc/ipsec.secrets +moon::tkm_cfgtool -c /etc/tkm/tkm.conf -i /etc/ipsec.conf -t /etc/tkm/tkm.bin -s /usr/local/share/tkm/tkmconfig.xsd +moon::cat /etc/ipsec.conf +moon::tkm_keymanager -c /etc/tkm/tkm.bin -k /etc/tkm/moonKey.der -r /etc/tkm/strongswanCert.der >/tmp/tkm.log 2>&1 & +moon::expect-file /tmp/tkm.rpc.ike +moon::DAEMON_NAME=charon-tkm ipsec start +moon::expect-file /tmp/tkm.rpc.ees +moon::xfrm_proxy >/tmp/xfrm_proxy.log 2>&1 & +moon::DAEMON_NAME=charon-tkm expect-connection conn1 +sun::expect-connection host-host +moon::ping -c 3 192.168.0.2 diff --git a/testing/tests/tkm/host2host-xfrmproxy/test.conf b/testing/tests/tkm/host2host-xfrmproxy/test.conf new file mode 100644 index 000000000..9647dc6a2 --- /dev/null +++ b/testing/tests/tkm/host2host-xfrmproxy/test.conf @@ -0,0 +1,21 @@ +#!/bin/bash +# +# This configuration file provides information on the +# guest instances used for this test + +# All guest instances that are required for this test +# +VIRTHOSTS="moon winnetou sun" + +# Corresponding block diagram +# +DIAGRAM="m-w-s.png" + +# Guest instances on which tcpdump is to be started +# +TCPDUMPHOSTS="sun" + +# Guest instances on which IPsec is started +# Used for IPsec logging purposes +# +IPSECHOSTS="moon sun" diff --git a/testing/tests/tkm/multiple-clients/description.txt b/testing/tests/tkm/multiple-clients/description.txt new file mode 100644 index 000000000..c8e72d51d --- /dev/null +++ b/testing/tests/tkm/multiple-clients/description.txt @@ -0,0 +1,5 @@ +Two transport connections to gateway sun are set up, one from client +carol and the other from client dave. The gateway sun uses +the Trusted Key Manager (TKM) and is the responder for both connections. The +authentication is based on X.509 certificates. In order to test the connections, +both carol and dave ping gateway sun. diff --git a/testing/tests/tkm/multiple-clients/evaltest.dat b/testing/tests/tkm/multiple-clients/evaltest.dat new file mode 100644 index 000000000..8e0042102 --- /dev/null +++ b/testing/tests/tkm/multiple-clients/evaltest.dat @@ -0,0 +1,23 @@ +sun::ipsec stroke status 2> /dev/null::conn1.*ESTABLISHED.*sun.strongswan.org.*carol.strongswan.org::YES +sun::ipsec stroke status 2> /dev/null::conn2.*ESTABLISHED.*sun.strongswan.org.*dave.strongswan.org::YES +carol::ipsec status 2> /dev/null::host-host.*ESTABLISHED.*carol.strongswan.org.*sun.strongswan.org::YES +dave::ipsec status 2> /dev/null::host-host.*ESTABLISHED.*dave.strongswan.org.*sun.strongswan.org::YES +sun::ipsec stroke status 2> /dev/null::conn1.*INSTALLED, TRANSPORT::YES +sun::ipsec stroke status 2> /dev/null::conn2.*INSTALLED, TRANSPORT::YES +carol::ipsec status 2> /dev/null::host-host.*INSTALLED, TRANSPORT::YES +dave::ipsec status 2> /dev/null::host-host.*INSTALLED, TRANSPORT::YES +carol::ping -c 1 PH_IP_SUN::64 bytes from PH_IP_SUN: icmp_req=1::YES +dave::ping -c 1 PH_IP_SUN::64 bytes from PH_IP_SUN: icmp_req=1::YES +carol::tcpdump::IP carol.strongswan.org > sun.strongswan.org: ESP::YES +carol::tcpdump::IP sun.strongswan.org > carol.strongswan.org: ESP::YES +dave::tcpdump::IP dave.strongswan.org > sun.strongswan.org: ESP::YES +dave::tcpdump::IP sun.strongswan.org > dave.strongswan.org: ESP::YES +sun::cat /tmp/tkm.log::RSA private key '/etc/tkm/sunKey.der' loaded::YES +sun::cat /tmp/tkm.log::Adding policy \[ 1, 192.168.0.2 <-> 192.168.0.100 \]::YES +sun::cat /tmp/tkm.log::Adding policy \[ 2, 192.168.0.2 <-> 192.168.0.200 \]::YES +sun::cat /tmp/tkm.log::Checked CA certificate of CC context 1::YES +sun::cat /tmp/tkm.log::Checked CA certificate of CC context 2::YES +sun::cat /tmp/tkm.log::Authentication of ISA context 1 successful::YES +sun::cat /tmp/tkm.log::Authentication of ISA context 2 successful::YES +sun::cat /tmp/tkm.log::Adding SA \[ 1, 192.168.0.2 <-> 192.168.0.100, SPI_in.*, SPI_out.*, soft 30, hard 60 \]::YES +sun::cat /tmp/tkm.log::Adding SA \[ 2, 192.168.0.2 <-> 192.168.0.200, SPI_in.*, SPI_out.*, soft 30, hard 60 \]::YES diff --git a/testing/tests/tkm/multiple-clients/hosts/carol/etc/ipsec.conf b/testing/tests/tkm/multiple-clients/hosts/carol/etc/ipsec.conf new file mode 100644 index 000000000..10ee3e89d --- /dev/null +++ b/testing/tests/tkm/multiple-clients/hosts/carol/etc/ipsec.conf @@ -0,0 +1,22 @@ +# /etc/ipsec.conf - strongSwan IPsec configuration file + +config setup + +conn %default + ikelifetime=60m + keylife=20m + rekeymargin=3m + keyingtries=1 + keyexchange=ikev2 + mobike=no + +conn host-host + left=PH_IP_CAROL + leftcert=carolCert.pem + leftid=carol@strongswan.org + right=PH_IP_SUN + rightid=sun.strongswan.org + ike=aes256-sha512-modp4096! + esp=aes256-sha512-modp4096! + type=transport + auto=add diff --git a/testing/tests/tkm/multiple-clients/hosts/carol/etc/strongswan.conf b/testing/tests/tkm/multiple-clients/hosts/carol/etc/strongswan.conf new file mode 100644 index 000000000..ca23c6971 --- /dev/null +++ b/testing/tests/tkm/multiple-clients/hosts/carol/etc/strongswan.conf @@ -0,0 +1,5 @@ +# /etc/strongswan.conf - strongSwan configuration file + +charon { + load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 revocation hmac stroke kernel-netlink socket-default updown +} diff --git a/testing/tests/tkm/multiple-clients/hosts/dave/etc/ipsec.conf b/testing/tests/tkm/multiple-clients/hosts/dave/etc/ipsec.conf new file mode 100644 index 000000000..6ba0a97ce --- /dev/null +++ b/testing/tests/tkm/multiple-clients/hosts/dave/etc/ipsec.conf @@ -0,0 +1,22 @@ +# /etc/ipsec.conf - strongSwan IPsec configuration file + +config setup + +conn %default + ikelifetime=60m + keylife=20m + rekeymargin=3m + keyingtries=1 + keyexchange=ikev2 + mobike=no + +conn host-host + left=PH_IP_DAVE + leftcert=daveCert.pem + leftid=dave@strongswan.org + right=PH_IP_SUN + rightid=sun.strongswan.org + ike=aes256-sha512-modp4096! + esp=aes256-sha512-modp4096! + type=transport + auto=add diff --git a/testing/tests/tkm/multiple-clients/hosts/dave/etc/strongswan.conf b/testing/tests/tkm/multiple-clients/hosts/dave/etc/strongswan.conf new file mode 100644 index 000000000..ca23c6971 --- /dev/null +++ b/testing/tests/tkm/multiple-clients/hosts/dave/etc/strongswan.conf @@ -0,0 +1,5 @@ +# /etc/strongswan.conf - strongSwan configuration file + +charon { + load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 revocation hmac stroke kernel-netlink socket-default updown +} diff --git a/testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/strongswanCert.der b/testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/strongswanCert.der new file mode 100644 index 000000000..a5a631f4b Binary files /dev/null and b/testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/strongswanCert.der differ diff --git a/testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/sunKey.der b/testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/sunKey.der new file mode 100644 index 000000000..4c47db093 Binary files /dev/null and b/testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/sunKey.der differ diff --git a/testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/tkm.conf b/testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/tkm.conf new file mode 100644 index 000000000..216625e4c --- /dev/null +++ b/testing/tests/tkm/multiple-clients/hosts/sun/etc/tkm/tkm.conf @@ -0,0 +1,36 @@ + + + sun.strongswan.org + sunCert.pem + + + transport + + 1 + 192.168.0.2 + + + carol@strongswan.org + 192.168.0.100 + + + 30 + 60 + + + + transport + + 1 + 192.168.0.2 + + + dave@strongswan.org + 192.168.0.200 + + + 30 + 60 + + + diff --git a/testing/tests/tkm/multiple-clients/posttest.dat b/testing/tests/tkm/multiple-clients/posttest.dat new file mode 100644 index 000000000..9a4a9bc9d --- /dev/null +++ b/testing/tests/tkm/multiple-clients/posttest.dat @@ -0,0 +1,5 @@ +sun::DAEMON_NAME=charon-tkm ipsec stop +sun::killall tkm_keymanager +sun::rm -f /tmp/tkm.rpc.ike /tmp/tkm.rpc.ees /tmp/tkm.log +carol::ipsec stop +dave::ipsec stop diff --git a/testing/tests/tkm/multiple-clients/pretest.dat b/testing/tests/tkm/multiple-clients/pretest.dat new file mode 100644 index 000000000..ec83662f5 --- /dev/null +++ b/testing/tests/tkm/multiple-clients/pretest.dat @@ -0,0 +1,14 @@ +sun::rm /etc/ipsec.secrets +sun::tkm_cfgtool -c /etc/tkm/tkm.conf -i /etc/ipsec.conf -t /etc/tkm/tkm.bin -s /usr/local/share/tkm/tkmconfig.xsd +sun::cat /etc/ipsec.conf +sun::tkm_keymanager -c /etc/tkm/tkm.bin -k /etc/tkm/sunKey.der -r /etc/tkm/strongswanCert.der >/tmp/tkm.log 2>&1 & +sun::expect-file /tmp/tkm.rpc.ike +sun::DAEMON_NAME=charon-tkm ipsec start +carol::ipsec start +carol::expect-connection host-host +dave::ipsec start +dave::expect-connection host-host +sun::DAEMON_NAME=charon-tkm expect-connection conn1 +sun::DAEMON_NAME=charon-tkm expect-connection conn2 +carol::ipsec up host-host +dave::ipsec up host-host diff --git a/testing/tests/tkm/multiple-clients/test.conf b/testing/tests/tkm/multiple-clients/test.conf new file mode 100644 index 000000000..1dd36309d --- /dev/null +++ b/testing/tests/tkm/multiple-clients/test.conf @@ -0,0 +1,21 @@ +#!/bin/bash +# +# This configuration file provides information on the +# guest instances used for this test + +# All guest instances that are required for this test +# +VIRTHOSTS="carol dave sun winnetou" + +# Corresponding block diagram +# +DIAGRAM="a-m-c-w-d-s.png" + +# Guest instances on which tcpdump is to be started +# +TCPDUMPHOSTS="carol dave" + +# Guest instances on which IPsec is started +# Used for IPsec logging purposes +# +IPSECHOSTS="carol dave sun" diff --git a/testing/tests/tkm/net2net-initiator/description.txt b/testing/tests/tkm/net2net-initiator/description.txt new file mode 100644 index 000000000..40f2a8013 --- /dev/null +++ b/testing/tests/tkm/net2net-initiator/description.txt @@ -0,0 +1,5 @@ +A connection between the subnets behind the gateways moon and sun +is set up. The host moon uses the Trusted Key Manager (TKM) and is the +initiator of the tunnel connection. The authentication is based on X.509 +certificates. In order to test the tunnel, client alice behind gateway +moon pings client bob located behind gateway sun. diff --git a/testing/tests/tkm/net2net-initiator/evaltest.dat b/testing/tests/tkm/net2net-initiator/evaltest.dat new file mode 100644 index 000000000..8d4794f0d --- /dev/null +++ b/testing/tests/tkm/net2net-initiator/evaltest.dat @@ -0,0 +1,12 @@ +moon::ipsec stroke status 2> /dev/null::conn1.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES +sun::ipsec status 2> /dev/null::net-net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES +moon::ipsec stroke status 2> /dev/null::conn1.*INSTALLED, TUNNEL::YES +sun::ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES +alice::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_req=1::YES +sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES +sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES +moon::cat /tmp/tkm.log::RSA private key '/etc/tkm/moonKey.der' loaded::YES +moon::cat /tmp/tkm.log::Adding policy \[ 1, 10.1.0.0/16 > 192.168.0.1 <=> 192.168.0.2 < 10.2.0.0/16 \]::YES +moon::cat /tmp/tkm.log::Checked CA certificate of CC context 1::YES +moon::cat /tmp/tkm.log::Authentication of ISA context 1 successful::YES +moon::cat /tmp/tkm.log::Adding SA \[ 1, 10.1.0.0/16 > 192.168.0.1 <=> 192.168.0.2 < 10.2.0.0/16, SPI_in.*, SPI_out.*, soft 30, hard 60 \]::YES diff --git a/testing/tests/tkm/net2net-initiator/hosts/moon/etc/tkm/moonKey.der b/testing/tests/tkm/net2net-initiator/hosts/moon/etc/tkm/moonKey.der new file mode 100644 index 000000000..97f0963f8 Binary files /dev/null and b/testing/tests/tkm/net2net-initiator/hosts/moon/etc/tkm/moonKey.der differ diff --git a/testing/tests/tkm/net2net-initiator/hosts/moon/etc/tkm/tkm.conf b/testing/tests/tkm/net2net-initiator/hosts/moon/etc/tkm/tkm.conf new file mode 100644 index 000000000..717b0a6f4 --- /dev/null +++ b/testing/tests/tkm/net2net-initiator/hosts/moon/etc/tkm/tkm.conf @@ -0,0 +1,23 @@ + + + moon.strongswan.org + moonCert.pem + + + tunnel + + 1 + 192.168.0.1 + 10.1.0.0 + + + sun.strongswan.org + 192.168.0.2 + 10.2.0.0 + + + 30 + 60 + + + diff --git a/testing/tests/tkm/net2net-initiator/hosts/sun/etc/ipsec.conf b/testing/tests/tkm/net2net-initiator/hosts/sun/etc/ipsec.conf new file mode 100644 index 000000000..21b613d20 --- /dev/null +++ b/testing/tests/tkm/net2net-initiator/hosts/sun/etc/ipsec.conf @@ -0,0 +1,23 @@ +# /etc/ipsec.conf - strongSwan IPsec configuration file + +config setup + +conn %default + ikelifetime=60m + keylife=20m + rekeymargin=3m + keyingtries=1 + keyexchange=ikev2 + mobike=no + +conn net-net + left=PH_IP_SUN + leftcert=sunCert.pem + leftid=sun.strongswan.org + leftsubnet=10.2.0.0/16 + right=PH_IP_MOON + rightid=moon.strongswan.org + rightsubnet=10.1.0.0/16 + ike=aes256-sha512-modp4096! + esp=aes256-sha512-modp4096! + auto=add diff --git a/testing/tests/tkm/net2net-initiator/hosts/sun/etc/strongswan.conf b/testing/tests/tkm/net2net-initiator/hosts/sun/etc/strongswan.conf new file mode 100644 index 000000000..94e0b2a62 --- /dev/null +++ b/testing/tests/tkm/net2net-initiator/hosts/sun/etc/strongswan.conf @@ -0,0 +1,6 @@ +# /etc/strongswan.conf - strongSwan configuration file + +charon { + load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 revocation hmac stroke kernel-netlink socket-default updown + multiple_authentication = no +} diff --git a/testing/tests/tkm/net2net-initiator/posttest.dat b/testing/tests/tkm/net2net-initiator/posttest.dat new file mode 100644 index 000000000..34037bc23 --- /dev/null +++ b/testing/tests/tkm/net2net-initiator/posttest.dat @@ -0,0 +1,4 @@ +moon::DAEMON_NAME=charon-tkm ipsec stop +moon::killall tkm_keymanager +moon::rm -f /tmp/tkm.rpc.ike /tmp/tkm.rpc.ees /tmp/tkm.log +sun::ipsec stop diff --git a/testing/tests/tkm/net2net-initiator/pretest.dat b/testing/tests/tkm/net2net-initiator/pretest.dat new file mode 100644 index 000000000..f84c8fcd2 --- /dev/null +++ b/testing/tests/tkm/net2net-initiator/pretest.dat @@ -0,0 +1,10 @@ +moon::rm /etc/ipsec.secrets +moon::tkm_cfgtool -c /etc/tkm/tkm.conf -i /etc/ipsec.conf -t /etc/tkm/tkm.bin -s /usr/local/share/tkm/tkmconfig.xsd +moon::cat /etc/ipsec.conf +moon::tkm_keymanager -c /etc/tkm/tkm.bin -k /etc/tkm/moonKey.der -r /etc/tkm/strongswanCert.der >/tmp/tkm.log 2>&1 & +moon::expect-file /tmp/tkm.rpc.ike +moon::DAEMON_NAME=charon-tkm ipsec start +sun::ipsec start +sun::expect-connection net-net +moon::DAEMON_NAME=charon-tkm expect-connection conn1 +moon::DAEMON_NAME=charon-tkm ipsec up conn1 diff --git a/testing/tests/tkm/net2net-initiator/test.conf b/testing/tests/tkm/net2net-initiator/test.conf new file mode 100644 index 000000000..afa2accbe --- /dev/null +++ b/testing/tests/tkm/net2net-initiator/test.conf @@ -0,0 +1,21 @@ +#!/bin/bash +# +# This configuration file provides information on the +# guest instances used for this test + +# All guest instances that are required for this test +# +VIRTHOSTS="alice moon winnetou sun bob" + +# Corresponding block diagram +# +DIAGRAM="a-m-w-s-b.png" + +# Guest instances on which tcpdump is to be started +# +TCPDUMPHOSTS="sun" + +# Guest instances on which IPsec is started +# Used for IPsec logging purposes +# +IPSECHOSTS="moon sun" diff --git a/testing/tests/tkm/net2net-xfrmproxy/description.txt b/testing/tests/tkm/net2net-xfrmproxy/description.txt new file mode 100644 index 000000000..b42c89c52 --- /dev/null +++ b/testing/tests/tkm/net2net-xfrmproxy/description.txt @@ -0,0 +1,6 @@ +A connection between the subnets behind the gateways moon and sun +is set up. The host moon starts the Trusted Key Manager (TKM) and the Ada +XFRM proxy, which relays XFRM kernel messages to charon. The authentication is +based on X.509 certificates. In order to test the tunnel, client alice +behind gateway moon pings client bob located behind gateway +sun. diff --git a/testing/tests/tkm/net2net-xfrmproxy/evaltest.dat b/testing/tests/tkm/net2net-xfrmproxy/evaltest.dat new file mode 100644 index 000000000..a38dba0ee --- /dev/null +++ b/testing/tests/tkm/net2net-xfrmproxy/evaltest.dat @@ -0,0 +1,13 @@ +moon::ipsec stroke status 2> /dev/null::conn1.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES +sun::ipsec status 2> /dev/null::net-net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES +moon::ipsec stroke status 2> /dev/null::conn1.*INSTALLED, TUNNEL::YES +sun::ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES +alice::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_req=1::YES +sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES +sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES +moon::cat /tmp/tkm.log::RSA private key '/etc/tkm/moonKey.der' loaded::YES +moon::cat /tmp/tkm.log::Adding policy \[ 1, 10.1.0.0/16 > 192.168.0.1 <=> 192.168.0.2 < 10.2.0.0/16 \]::YES +moon::cat /tmp/tkm.log::Checked CA certificate of CC context 1::YES +moon::cat /tmp/tkm.log::Authentication of ISA context 1 successful::YES +moon::cat /tmp/tkm.log::Adding SA \[ 1, 10.1.0.0/16 > 192.168.0.1 <=> 192.168.0.2 < 10.2.0.0/16, SPI_in.*, SPI_out.*, soft 30, hard 60 \]::YES +moon::cat /tmp/xfrm_proxy.log::Initiating ESA acquire for reqid 1::YES diff --git a/testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/moonKey.der b/testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/moonKey.der new file mode 100644 index 000000000..97f0963f8 Binary files /dev/null and b/testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/moonKey.der differ diff --git a/testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/strongswanCert.der b/testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/strongswanCert.der new file mode 100644 index 000000000..a5a631f4b Binary files /dev/null and b/testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/strongswanCert.der differ diff --git a/testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/tkm.conf b/testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/tkm.conf new file mode 100644 index 000000000..717b0a6f4 --- /dev/null +++ b/testing/tests/tkm/net2net-xfrmproxy/hosts/moon/etc/tkm/tkm.conf @@ -0,0 +1,23 @@ + + + moon.strongswan.org + moonCert.pem + + + tunnel + + 1 + 192.168.0.1 + 10.1.0.0 + + + sun.strongswan.org + 192.168.0.2 + 10.2.0.0 + + + 30 + 60 + + + diff --git a/testing/tests/tkm/net2net-xfrmproxy/hosts/sun/etc/ipsec.conf b/testing/tests/tkm/net2net-xfrmproxy/hosts/sun/etc/ipsec.conf new file mode 100644 index 000000000..21b613d20 --- /dev/null +++ b/testing/tests/tkm/net2net-xfrmproxy/hosts/sun/etc/ipsec.conf @@ -0,0 +1,23 @@ +# /etc/ipsec.conf - strongSwan IPsec configuration file + +config setup + +conn %default + ikelifetime=60m + keylife=20m + rekeymargin=3m + keyingtries=1 + keyexchange=ikev2 + mobike=no + +conn net-net + left=PH_IP_SUN + leftcert=sunCert.pem + leftid=sun.strongswan.org + leftsubnet=10.2.0.0/16 + right=PH_IP_MOON + rightid=moon.strongswan.org + rightsubnet=10.1.0.0/16 + ike=aes256-sha512-modp4096! + esp=aes256-sha512-modp4096! + auto=add diff --git a/testing/tests/tkm/net2net-xfrmproxy/hosts/sun/etc/strongswan.conf b/testing/tests/tkm/net2net-xfrmproxy/hosts/sun/etc/strongswan.conf new file mode 100644 index 000000000..94e0b2a62 --- /dev/null +++ b/testing/tests/tkm/net2net-xfrmproxy/hosts/sun/etc/strongswan.conf @@ -0,0 +1,6 @@ +# /etc/strongswan.conf - strongSwan configuration file + +charon { + load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 revocation hmac stroke kernel-netlink socket-default updown + multiple_authentication = no +} diff --git a/testing/tests/tkm/net2net-xfrmproxy/posttest.dat b/testing/tests/tkm/net2net-xfrmproxy/posttest.dat new file mode 100644 index 000000000..24544307a --- /dev/null +++ b/testing/tests/tkm/net2net-xfrmproxy/posttest.dat @@ -0,0 +1,4 @@ +moon::DAEMON_NAME=charon-tkm ipsec stop +moon::killall tkm_keymanager +moon::rm -f /tmp/tkm.rpc.ike /tmp/tkm.rpc.ees /tmp/tkm.log /tmp/xfrm_proxy.log +sun::ipsec stop diff --git a/testing/tests/tkm/net2net-xfrmproxy/pretest.dat b/testing/tests/tkm/net2net-xfrmproxy/pretest.dat new file mode 100644 index 000000000..4732a37f6 --- /dev/null +++ b/testing/tests/tkm/net2net-xfrmproxy/pretest.dat @@ -0,0 +1,12 @@ +sun::ipsec start +moon::rm /etc/ipsec.secrets +moon::tkm_cfgtool -c /etc/tkm/tkm.conf -i /etc/ipsec.conf -t /etc/tkm/tkm.bin -s /usr/local/share/tkm/tkmconfig.xsd +moon::cat /etc/ipsec.conf +moon::tkm_keymanager -c /etc/tkm/tkm.bin -k /etc/tkm/moonKey.der -r /etc/tkm/strongswanCert.der >/tmp/tkm.log 2>&1 & +moon::expect-file /tmp/tkm.rpc.ike +moon::DAEMON_NAME=charon-tkm ipsec start +moon::expect-file /tmp/tkm.rpc.ees +moon::xfrm_proxy >/tmp/xfrm_proxy.log 2>&1 & +moon::DAEMON_NAME=charon-tkm expect-connection conn1 +sun::expect-connection net-net +alice::ping -c 3 PH_IP_BOB diff --git a/testing/tests/tkm/net2net-xfrmproxy/test.conf b/testing/tests/tkm/net2net-xfrmproxy/test.conf new file mode 100644 index 000000000..afa2accbe --- /dev/null +++ b/testing/tests/tkm/net2net-xfrmproxy/test.conf @@ -0,0 +1,21 @@ +#!/bin/bash +# +# This configuration file provides information on the +# guest instances used for this test + +# All guest instances that are required for this test +# +VIRTHOSTS="alice moon winnetou sun bob" + +# Corresponding block diagram +# +DIAGRAM="a-m-w-s-b.png" + +# Guest instances on which tcpdump is to be started +# +TCPDUMPHOSTS="sun" + +# Guest instances on which IPsec is started +# Used for IPsec logging purposes +# +IPSECHOSTS="moon sun" -- cgit v1.2.3