/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: systemctl start ipsec.service
west #
 /testing/pluto/bin/wait-until-pluto-started
west #
 ipsec auto --add nss-cert-incorrect
002 added connection description "nss-cert-incorrect"
west #
 ipsec auto --add nss-cert-correct
002 added connection description "nss-cert-correct"
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
002 "nss-cert-correct" #1: initiating v2 parent SA
1v2 "nss-cert-correct" #1: initiate
1v2 "nss-cert-correct" #1: STATE_PARENT_I1: sent v2I1, expected v2R1
1v2 "nss-cert-correct" #2: STATE_PARENT_I2: sent v2I2, expected v2R2 {auth=IKEv2 cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=MODP2048}
002 "nss-cert-correct" #2: certificate verified OK: E=user-east@testing.libreswan.org,CN=east.testing.libreswan.org,OU=Test Department,O=Libreswan,L=Toronto,ST=Ontario,C=CA
002 "nss-cert-correct" #2: IKEv2 mode peer ID is ID_DER_ASN1_DN: 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=user-east@testing.libreswan.org'
003 "nss-cert-correct" #2: Authenticated using RSA
002 "nss-cert-correct" #2: negotiated connection [192.0.1.254-192.0.1.254:0-65535 0] -> [192.0.2.254-192.0.2.254:0-65535 0]
004 "nss-cert-correct" #2: STATE_V2_IPSEC_I: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE NATOA=none NATD=none DPD=passive}
west #
 ipsec auto --down nss-cert-correct
002 "nss-cert-correct": terminating SAs using this connection
002 "nss-cert-correct" #2: deleting state (STATE_V2_IPSEC_I) and sending notification
005 "nss-cert-correct" #2: ESP traffic information: in=0B out=0B
002 "nss-cert-correct" #1: deleting state (STATE_PARENT_I3) and sending notification
west #
 # should fail on mismatched ID
west #
 ipsec auto --up nss-cert-incorrect
002 "nss-cert-incorrect" #3: initiating v2 parent SA
1v2 "nss-cert-incorrect" #3: initiate
1v2 "nss-cert-incorrect" #3: STATE_PARENT_I1: sent v2I1, expected v2R1
1v2 "nss-cert-incorrect" #4: STATE_PARENT_I2: sent v2I2, expected v2R2 {auth=IKEv2 cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=MODP2048}
002 "nss-cert-incorrect" #4: certificate verified OK: E=user-east@testing.libreswan.org,CN=east.testing.libreswan.org,OU=Test Department,O=Libreswan,L=Toronto,ST=Ontario,C=CA
003 "nss-cert-incorrect" #4: 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" #4: Peer public key SubjectAltName does not match peer ID for this connection
002 "nss-cert-incorrect" #4: X509: CERT payload does not match connection ID
west #
 echo done
done
west #
west #
 ../bin/check-for-core.sh
west #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi

