/testing/guestbin/swan-prep
west #
 pk12util -W foobar -K '' -d sql:/etc/ipsec.d -i /testing/x509/selfsigned/west-selfsigned.p12
pk12util: no nickname for cert in PKCS12 file.
pk12util: using nickname: west-selfsigned.testing.libreswan.org
pk12util: PKCS12 IMPORT SUCCESSFUL
west #
 pk12util -W foobar -K '' -d sql:/etc/ipsec.d -i /testing/x509/selfsigned/east-selfsigned.p12
pk12util: no nickname for cert in PKCS12 file.
pk12util: using nickname: east-selfsigned.testing.libreswan.org
pk12util: PKCS12 IMPORT SUCCESSFUL
west #
 pk12util -W foobar -K '' -d sql:/etc/ipsec.d -i /testing/x509/selfsigned/road-selfsigned.p12
pk12util: no nickname for cert in PKCS12 file.
pk12util: using nickname: road-selfsigned.testing.libreswan.org
pk12util: PKCS12 IMPORT SUCCESSFUL
west #
 ipsec start
Redirecting to: [initsystem]
west #
 /testing/pluto/bin/wait-until-pluto-started
west #
 ipsec auto --add west-x509
002 added connection description "west-x509"
west #
 ipsec auto --add road-x509
002 added connection description "road-x509"
west #
 echo "initdone"
initdone
west #
 ipsec auto --up west-x509
1v2 "west-x509" #1: initiating IKEv2 IKE SA
1v2 "west-x509" #1: STATE_PARENT_I1: sent v2I1, expected v2R1
1v2 "west-x509" #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 "west-x509" #2: IKEv2 mode peer ID is ID_DER_ASN1_DN: 'CN=east-selfsigned.testing.libreswan.org'
003 "west-x509" #2: Authenticated using RSA with IKEv2_AUTH_HASH_SHA2_512
002 "west-x509" #2: negotiated connection [192.1.2.45-192.1.2.45:0-65535 0] -> [192.1.2.23-192.1.2.23:0-65535 0]
004 "west-x509" #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 whack --impair delete-on-retransmit
west #
 # this one should fail, as east is only expecting selfsigned cert of west, not road
west #
 ipsec auto --up road-x509
1v2 "road-x509" #3: initiating IKEv2 IKE SA
1v2 "road-x509" #3: STATE_PARENT_I1: sent v2I1, expected v2R1
1v2 "road-x509" #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 "road-x509" #4: IKE SA authentication request rejected by peer: AUTHENTICATION_FAILED
000 "road-x509" #4: scheduling retry attempt 1 of an unlimited number, but releasing whack
west #
 echo "done"
done
west #
 ../bin/check-for-core.sh
west #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi

