/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 #
 echo "initdone"
initdone
west #
 # the impair causes memory corruption and a crash ?
west #
 ipsec whack --debug-all --impair-retransmits
west #
 # should succeed
west #
 ipsec auto --up nss-cert-correct
002 "nss-cert-correct" #1: initiating v2 parent SA
133 "nss-cert-correct" #1: STATE_PARENT_I1: initiate
133 "nss-cert-correct" #1: STATE_PARENT_I1: sent v2I1, expected v2R1
002 "nss-cert-correct" #1: suppressing retransmit because IMPAIR_RETRANSMITS is set.
134 "nss-cert-correct" #2: STATE_PARENT_I2: sent v2I2, expected v2R2 {auth=IKEv2 cipher=aes_gcm_16_256 integ=n/a prf=sha2_512 group=MODP2048}
002 "nss-cert-correct" #2: suppressing retransmit because IMPAIR_RETRANSMITS is set.
002 "nss-cert-correct" #2: certificate E=testing@libreswan.org,CN=east.testing.libreswan.org,OU=Test Department,O=Libreswan,L=Toronto,ST=Ontario,C=CA OK
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=testing@libreswan.org'
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_C_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_PARENT_I3)
005 "nss-cert-correct" #2: ESP traffic information: in=0B out=0B
002 "nss-cert-correct" #1: deleting state (STATE_PARENT_I3)
west #
 # should fail on mismatched ID
west #
 ipsec auto --up nss-cert-incorrect
002 "nss-cert-incorrect" #3: initiating v2 parent SA
133 "nss-cert-incorrect" #3: STATE_PARENT_I1: initiate
133 "nss-cert-incorrect" #3: STATE_PARENT_I1: sent v2I1, expected v2R1
002 "nss-cert-incorrect" #3: suppressing retransmit because IMPAIR_RETRANSMITS is set.
134 "nss-cert-incorrect" #4: STATE_PARENT_I2: sent v2I2, expected v2R2 {auth=IKEv2 cipher=aes_gcm_16_256 integ=n/a prf=sha2_512 group=MODP2048}
002 "nss-cert-incorrect" #4: suppressing retransmit because IMPAIR_RETRANSMITS is set.
002 "nss-cert-incorrect" #4: certificate E=testing@libreswan.org,CN=east.testing.libreswan.org,OU=Test Department,O=Libreswan,L=Toronto,ST=Ontario,C=CA OK
003 "nss-cert-incorrect" #4: we require IKEv2 peer to have ID 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=road.testing.libreswan.org, E=testing@libreswan.org', but peer declares 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=testing@libreswan.org'
224 "nss-cert-incorrect" #4: STATE_PARENT_I2: v2N_AUTHENTICATION_FAILED
west #
 echo done
done
west #
 certutil -L -d sql:/etc/ipsec.d/
Certificate Nickname                                         Trust Attributes
                                                             SSL,S/MIME,JAR/XPI
west                                                         u,u,u
Libreswan test CA for mainca - Libreswan                     CT,, 
north                                                        P,,  
hashsha2                                                     P,,  
east-ec                                                      P,,  
nic                                                          P,,  
west #
west #
 if [ -n "`ls /tmp/core* 2>/dev/null`" ]; then echo CORE FOUND; mv /tmp/core* OUTPUT/; fi
CORE FOUND
mv: failed to preserve ownership for ‘OUTPUT/core.west.pluto.2316’: Operation not permitted
west #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi

