#!/usr/bin/ksh # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2018, Joyent, Inc. # if [[ `id -u` != 0 ]]; then echo "Need to be root or have effective UID of root." exit 255 fi # # Two birds with one stone. # # 1.) Add some simple SAs. # 2.) Run C programs that use SADB_UPDATE to alter the SAs' KM cookies. # # This tests both SADB_UPDATE of an SA's KM cookie, and the C programs can # test (or not) cookie/cookie64 and the IKEv1 exception. # SADB_X_KMP_KINK=2 SADB_X_KMP_IKEV2=3 COOKIE_IKEV2="0x111770171170" EINVAL=22 # Add three simple SAs. Will delete them first, out of paranoia. ipseckey 2>&1 >/dev/null <