/testing/guestbin/swan-prep
road #
 cp road-ikev2-oe.conf /etc/ipsec.d/ikev2-oe.conf
road #
 cp policies/* /etc/ipsec.d/policies/
road #
 echo "192.1.2.0/24"  >> /etc/ipsec.d/policies/private-or-clear
road #
 ipsec start
Redirecting to: systemctl start ipsec.service
road #
 /testing/pluto/bin/wait-until-pluto-started
road #
 #ipsec whack --impair suppress-retransmits
road #
 # ensure for tests acquires expire before our failureshunt=2m
road #
 echo 30 > /proc/sys/net/core/xfrm_acq_expires
road #
 # give OE policies time to load
road #
 sleep 5
road #
 ipsec whack --listpubkeys
000  
000 List of Public Keys:
000  
road #
 echo "initdone"
initdone
road #
 # Expected to fail as all IPSECKEY's are wrong
road #
 ipsec whack --oppohere 192.1.3.209 --oppothere 192.1.2.67
002 initiate on demand from 192.1.3.209:0 to 192.1.2.67:0 proto=0 because: whack
1v2 "private-or-clear#192.1.2.0/24"[1] ...192.1.2.67 #1: initiate
003 "private-or-clear#192.1.2.0/24"[1] ...192.1.2.67 #2: Signature check (on 192.1.2.67) failed: tried *AQBBBBBBB *AQAAAAAAA keys but none worked.
002 "private-or-clear#192.1.2.0/24"[1] ...192.1.2.67 #2: RSA authentication failed
036 "private-or-clear#192.1.2.0/24"[1] ...192.1.2.67 #2: encountered fatal error in state STATE_PARENT_I2
road #
 grep "DNS QUESTION" /tmp/pluto.log
| DNS QUESTION 67.2.1.192.IN-ADDR.ARPA.\011IN\011IPSECKEY 
road #
 # should show large set of keys in pluto cache from IPSECKEY records
road #
 ipsec whack --listpubkeys
000  
000 List of Public Keys:
000  
000 TIMESTAMP, 2192 RSA Key AQBBBBBBB (no private key), until TIMESTAMP warning (expires in X days)
000        ID_IPV4_ADDR '192.1.2.67'
000 TIMESTAMP, 2192 RSA Key AQAAAAAAA (no private key), until TIMESTAMP warning (expires in X days)
000        ID_IPV4_ADDR '192.1.2.67'
road #
 echo done
done
road #
 # you should see one RSA and on NULL only
road #
 grep IKEv2_AUTH_ /tmp/pluto.log
|    auth method: IKEv2_AUTH_NULL (0xd)
|    auth method: IKEv2_AUTH_RSA (0x1)
road #
 # no ipsec tunnel should be up
road #
 ipsec whack --trafficstatus
road #
road #
 ../bin/check-for-core.sh
road #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi

