/testing/guestbin/swan-prep --x509
Preparing X.509 files
west #
 certutil -D -d sql:/etc/ipsec.d -n road
west #
 certutil -D -d sql:/etc/ipsec.d -n east
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec auto --add nss-cert-incorrect
002 "nss-cert-incorrect": added IKEv2 connection
west #
 ipsec auto --add nss-cert-correct
002 "nss-cert-correct": added IKEv2 connection
west #
 ipsec whack --impair suppress-retransmits
west #
 echo "initdone"
initdone
west #
 # the impair causes memory corruption and a crash ?
west #
 ipsec whack --impair suppress-retransmits
west #
 # should succeed
west #
 ipsec auto --up nss-cert-correct
1v2 "nss-cert-correct" #1: initiating IKEv2 connection
1v2 "nss-cert-correct" #1: sent IKE_SA_INIT request to 192.1.2.23:500
1v2 "nss-cert-correct" #1: sent IKE_AUTH request {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=MODP2048}
003 "nss-cert-correct" #1: initiator established IKE SA; authenticated peer '3nnn-bit RSASSA-PSS with SHA2_512' digital signature using peer certificate 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=user-east@testing.libreswan.org' issued by CA 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=Libreswan test CA for mainca, E=testing@libreswan.org'
004 "nss-cert-correct" #2: initiator established Child SA using #1; IPsec tunnel [192.0.1.254-192.0.1.254:0-65535 0] -> [192.0.2.254-192.0.2.254:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
west #
 ipsec auto --down nss-cert-correct
002 "nss-cert-correct": terminating SAs using this connection
002 "nss-cert-correct" #1: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
005 "nss-cert-correct" #2: ESP traffic information: in=0B out=0B
west #
 # should fail on mismatched ID
west #
 ipsec auto --up nss-cert-incorrect
1v2 "nss-cert-incorrect" #3: initiating IKEv2 connection
1v2 "nss-cert-incorrect" #3: sent IKE_SA_INIT request to 192.1.2.23:500
1v2 "nss-cert-incorrect" #3: sent IKE_AUTH request {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=MODP2048}
003 "nss-cert-incorrect" #3: X509: authentication failed; peer ID_DER_ASN1_DN 'E=user-east@testing.libreswan.org,CN=east.testing.libreswan.org,OU=Test Department,O=Libreswan,L=Toronto,ST=Ontario,C=CA' does not match expected 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=road.testing.libreswan.org, E=user-road@testing.libreswan.org'
002 "nss-cert-incorrect" #3: deleting state (STATE_V2_PARENT_I2) and sending notification
002 "nss-cert-incorrect" #3: deleting IKE SA but connection is supposed to remain up; schedule EVENT_REVIVE_CONNS
west #
 echo done
done
west #
 
