From 2ecafc7316f6d4e7687f369766768244e3be0bb0 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Tue, 8 Feb 2011 22:58:31 +0100 Subject: [PATCH] added openssl-ikev2/critical-extension scenario --- .../critical-extension/description.txt | 5 ++++ .../critical-extension/evaltest.dat | 6 +++++ .../hosts/moon/etc/ipsec.conf | 25 ++++++++++++++++++ .../hosts/moon/etc/ipsec.d/certs/moonCert.der | Bin 0 -> 952 bytes .../hosts/moon/etc/strongswan.conf | 12 +++++++++ .../hosts/sun/etc/ipsec.conf | 25 ++++++++++++++++++ .../hosts/sun/etc/ipsec.d/certs/sunCert.der | Bin 0 -> 951 bytes .../hosts/sun/etc/strongswan.conf | 6 +++++ .../critical-extension/posttest.dat | 5 ++++ .../critical-extension/pretest.dat | 6 +++++ .../critical-extension/test.conf | 21 +++++++++++++++ 11 files changed, 111 insertions(+) create mode 100644 testing/tests/openssl-ikev2/critical-extension/description.txt create mode 100644 testing/tests/openssl-ikev2/critical-extension/evaltest.dat create mode 100755 testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/ipsec.conf create mode 100644 testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/ipsec.d/certs/moonCert.der create mode 100644 testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/strongswan.conf create mode 100755 testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/ipsec.conf create mode 100644 testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/ipsec.d/certs/sunCert.der create mode 100644 testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/strongswan.conf create mode 100644 testing/tests/openssl-ikev2/critical-extension/posttest.dat create mode 100644 testing/tests/openssl-ikev2/critical-extension/pretest.dat create mode 100644 testing/tests/openssl-ikev2/critical-extension/test.conf diff --git a/testing/tests/openssl-ikev2/critical-extension/description.txt b/testing/tests/openssl-ikev2/critical-extension/description.txt new file mode 100644 index 0000000000..8c0d37c888 --- /dev/null +++ b/testing/tests/openssl-ikev2/critical-extension/description.txt @@ -0,0 +1,5 @@ +A connection between the subnets behind the gateways moon and sun is set up. +The authentication is based on X.509 certificates which contain a critical but +unsupported 'strongSwan' extension. Whereas moon ignores unsupported critical +extensions by setting libstrongswan.x509.enforce_critical = no in strongswan.conf, +sun discards such certificates and aborts the connection setup. diff --git a/testing/tests/openssl-ikev2/critical-extension/evaltest.dat b/testing/tests/openssl-ikev2/critical-extension/evaltest.dat new file mode 100644 index 0000000000..1c23dcad62 --- /dev/null +++ b/testing/tests/openssl-ikev2/critical-extension/evaltest.dat @@ -0,0 +1,6 @@ +moon::cat /var/log/daemon.log::sending end entity cert::YES +moon::cat /var/log/daemon.log::received AUTHENTICATION_FAILED notify error::YES +sun::cat /var/log/daemon.log::found unsupported critical X.509 extension::YES +sun::cat /var/log/daemon.log::building CRED_CERTIFICATE - ANY failed::YES +sun::cat /var/log/daemon.log::loading certificate from 'sunCert.der' failed::YES +sun::cat /var/log/daemon.log::building CRED_CERTIFICATE - X509 failed::YES diff --git a/testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/ipsec.conf b/testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/ipsec.conf new file mode 100755 index 0000000000..2e3c9dde45 --- /dev/null +++ b/testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/ipsec.conf @@ -0,0 +1,25 @@ +# /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 + keyexchange=ikev2 + mobike=no + +conn net-net + left=PH_IP_MOON + leftcert=moonCert.der + leftid=@moon.strongswan.org + leftsubnet=10.1.0.0/16 + leftfirewall=yes + right=PH_IP_SUN + rightid=@sun.strongswan.org + rightsubnet=10.2.0.0/16 + auto=add diff --git a/testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/ipsec.d/certs/moonCert.der b/testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/ipsec.d/certs/moonCert.der new file mode 100644 index 0000000000000000000000000000000000000000..7f78d5820a27f013eddc56f67612e246714db245 GIT binary patch literal 952 zcmXqLV%}oV#589CGZP~d6GsKtiqC&tHLn@)vT?UyX(Qxs7MfdT71PV}rJjTOU8; zGlSpnCrMV9b9}x1|5cr5QrooL(lsBguRbxal2E*%`;h6?{h7&II$5N+`RA8ypQjkG z%94rCeyLV^?e6wDGm<7g`52=A=!2)GsT zo|#OnW|0<`&KiE&_txNf;?f+Zn|GQ%oPB@tii!KSmHlNJ>n^Pks`8r3(%hf+Jg_c~ zo2}@CSV+m9XPw`z@{c_}uC3$h*?W5rxA+E6(S-b${;E00%a7;;yC(eK{dCpYn=WU1 zw_IAizDv{VYc%t+1yUi`TMSlLSWFK-)Xv1r$iTR`ahXBmVgq?#ILa!sNEnDUh{P_x zTfi1*RQG&a?&hseA0)ie^L=k12T~x&B5oksgf*}Q*f_P>7+Dyb7HBatGX7^_Fc1dm zP-WpU;9}zdO0lxCGcy`kf&}GRj0_A6^cLtW&}!4jC@Cqh($`Ne%0Y`ieWd6F$|6T4 zFfjt7l96G4@$oHNr7l{|+&TTnJ2769_f0+WqVqXKk8XIl;>rUF!5U5d=!gF@BQz3w zo$qYl_%tlw9kcG)BOa=0b<6&pPvLEdd+G1Ywdm7qh4Zdk{>V)(I-+t|?6*<)qrG}B z_a*XseQ_~wdMC3;)-vO_^hc@LSFXH|ZJl{2NBB_sd$MFzCNi&;B{Dl+}48gem#HBdrXYX+j2Ll z+V4g1lIQX*_p=HgESRKNeEGYko)_Eqlux%>bm~59J=^orV9$ePCtKXlJ+E_K#9wc2 W!v5IMB+hKx;?FMmD=smHPXPd1m~$rp literal 0 HcmV?d00001 diff --git a/testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/strongswan.conf b/testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/strongswan.conf new file mode 100644 index 0000000000..f4ab41f2c4 --- /dev/null +++ b/testing/tests/openssl-ikev2/critical-extension/hosts/moon/etc/strongswan.conf @@ -0,0 +1,12 @@ +# /etc/strongswan.conf - strongSwan configuration file + +charon { + load = curl pem pkcs1 random openssl revocation hmac stroke kernel-netlink socket-default updown + multiple_authentication = no +} + +libstrongswan { + x509 { + enforce_critical = no + } +} diff --git a/testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/ipsec.conf b/testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/ipsec.conf new file mode 100755 index 0000000000..19e1971318 --- /dev/null +++ b/testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/ipsec.conf @@ -0,0 +1,25 @@ +# /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 + keyexchange=ikev2 + mobike=no + +conn net-net + left=PH_IP_SUN + leftcert=sunCert.der + leftid=@sun.strongswan.org + leftsubnet=10.2.0.0/16 + leftfirewall=yes + right=PH_IP_MOON + rightid=@moon.strongswan.org + rightsubnet=10.1.0.0/16 + auto=add diff --git a/testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/ipsec.d/certs/sunCert.der b/testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/ipsec.d/certs/sunCert.der new file mode 100644 index 0000000000000000000000000000000000000000..c1efb6719c6435ede4afe4e5466156bc84a9194e GIT binary patch literal 951 zcmXqLV%}`f#58*WGZP~d6DPyMqEn))of>Kkc-c6$+C196^D;7WvoaXC8gd(OvN4CU zun99cdl*U@h=Vv>!U8^-d8HK!#U(}gdFjFBiFt<729h8tW?>nx_Y`su*a$UVc%!K@+1AvIiJh8JL?G`5A!X zTue=jj12duhIFOBlT_Cmmq2`lU-$XY`er27qR77}} zc&6F?A78sSI?s2mO0!iI`><(KlT59e)TSKXTl4bWR{lPs?^*bm>u&t|%e5nTsqf zjQ*Hh?3z#`#8J*-v`g$D6EhRfk=~3F=ki`uyJa$F|sf=Ezn|QWc<&HPu8o#mSh-Y~E5o;&yG$t(pf z=6zAstBiZSIJWMxkomYeDCF?xg`ytc--(}kE3tRsR$cwZT;_istl@!6JzcJ8{`u3Q znRo2zJdJfauOE9vi=@ambw~1Y=TFs3Ivl&?2H(Tnm3zGZihW4GzNU{^_SO1o^)#Ke O^SLCBwmd#!eg**BcxnOw literal 0 HcmV?d00001 diff --git a/testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/strongswan.conf b/testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/strongswan.conf new file mode 100644 index 0000000000..c45805ca6c --- /dev/null +++ b/testing/tests/openssl-ikev2/critical-extension/hosts/sun/etc/strongswan.conf @@ -0,0 +1,6 @@ +# /etc/strongswan.conf - strongSwan configuration file + +charon { + load = curl pem pkcs1 random openssl revocation hmac stroke kernel-netlink socket-default updown + multiple_authentication = no +} diff --git a/testing/tests/openssl-ikev2/critical-extension/posttest.dat b/testing/tests/openssl-ikev2/critical-extension/posttest.dat new file mode 100644 index 0000000000..a4c96e10f8 --- /dev/null +++ b/testing/tests/openssl-ikev2/critical-extension/posttest.dat @@ -0,0 +1,5 @@ +moon::ipsec stop +sun::ipsec stop +moon::/etc/init.d/iptables stop 2> /dev/null +sun::/etc/init.d/iptables stop 2> /dev/null + diff --git a/testing/tests/openssl-ikev2/critical-extension/pretest.dat b/testing/tests/openssl-ikev2/critical-extension/pretest.dat new file mode 100644 index 0000000000..2d7a78acb2 --- /dev/null +++ b/testing/tests/openssl-ikev2/critical-extension/pretest.dat @@ -0,0 +1,6 @@ +moon::/etc/init.d/iptables start 2> /dev/null +sun::/etc/init.d/iptables start 2> /dev/null +moon::ipsec start +sun::ipsec start +moon::sleep 1 +moon::ipsec up net-net diff --git a/testing/tests/openssl-ikev2/critical-extension/test.conf b/testing/tests/openssl-ikev2/critical-extension/test.conf new file mode 100644 index 0000000000..41ee3037e4 --- /dev/null +++ b/testing/tests/openssl-ikev2/critical-extension/test.conf @@ -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 winnetou sun bob" + +# Corresponding block diagram +# +DIAGRAM="a-m-w-s-b.png" + +# UML instances on which tcpdump is to be started +# +TCPDUMPHOSTS="" + +# UML instances on which IPsec is started +# Used for IPsec logging purposes +# +IPSECHOSTS="moon sun"