From 1659d0336ca0812df08c334e97eee143ac55bc87 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Sun, 2 Jun 2019 21:08:43 -0500 Subject: [PATCH] Support Libreswan 3.28 - Support upgrading to new Libreswan version 3.28 - Patch applied for Debian 9/8. See: https://lists.libreswan.org/pipermail/swan/2019/003210.html - Patch applied for CentOS 6. See: https://github.com/libreswan/libreswan/commit/5db185497dcfff703391db955138b6c5d54a8893 and https://github.com/libreswan/libreswan/commit/4b93354f3575e4c6abe91a4e95f6fd43f4a99b0c --- extras/vpnupgrade.sh | 41 +++++++++++++++++++++++++++++-------- extras/vpnupgrade_centos.sh | 36 ++++++++++++++++++++++++-------- 2 files changed, 59 insertions(+), 18 deletions(-) diff --git a/extras/vpnupgrade.sh b/extras/vpnupgrade.sh index 6aa162d857..65bcfb90ff 100644 --- a/extras/vpnupgrade.sh +++ b/extras/vpnupgrade.sh @@ -11,7 +11,7 @@ # know how you have improved it! # Specify which Libreswan version to install. See: https://libreswan.org -SWAN_VER=3.27 +SWAN_VER=3.28 ### DO NOT edit below this line ### @@ -44,14 +44,14 @@ if [ "$(id -u)" != 0 ]; then fi case "$SWAN_VER" in - 3.19|3.2[0123567]) + 3.19|3.2[01235678]) /bin/true ;; *) cat 1>&2 < Makefile.inc.local <<'EOF' WERROR_CFLAGS = USE_DNSSEC = false USE_DH31 = false +USE_NSS_AVA_COPY=true +USE_NSS_IPSEC_PROFILE=false USE_GLIBC_KERN_FLIP_HEADERS = true EOF if [ "$(packaging/utils/lswan_detect.sh init)" = "systemd" ]; then @@ -239,6 +257,11 @@ elif [ "$dns_state" = "4" ]; then sed -i "s/modecfgdns=.*/modecfgdns1=$DNS_SRV1/" /etc/ipsec.conf fi +if [ "$SWAN_VER" = "3.28" ]; then + sed -i "/ikev2=never/d" /etc/ipsec.conf + sed -i "/dpdaction=clear/a \ ikev2=never" /etc/ipsec.conf +fi + # Restart IPsec service mkdir -p /run/pluto service ipsec restart diff --git a/extras/vpnupgrade_centos.sh b/extras/vpnupgrade_centos.sh index f267056a94..400a0b1611 100644 --- a/extras/vpnupgrade_centos.sh +++ b/extras/vpnupgrade_centos.sh @@ -11,7 +11,7 @@ # know how you have improved it! # Specify which Libreswan version to install. See: https://libreswan.org -SWAN_VER=3.27 +SWAN_VER=3.28 ### DO NOT edit below this line ### @@ -35,14 +35,14 @@ if [ "$(id -u)" != 0 ]; then fi case "$SWAN_VER" in - 3.19|3.2[0123567]) + 3.19|3.2[01235678]) /bin/true ;; *) cat 1>&2 < Makefile.inc.local <<'EOF' WERROR_CFLAGS = USE_DNSSEC = false USE_DH31 = false +USE_NSS_AVA_COPY=true +USE_NSS_IPSEC_PROFILE=false USE_GLIBC_KERN_FLIP_HEADERS = true EOF NPROCS=$(grep -c ^processor /proc/cpuinfo) @@ -237,6 +250,11 @@ elif [ "$dns_state" = "4" ]; then sed -i "s/modecfgdns=.*/modecfgdns1=$DNS_SRV1/" /etc/ipsec.conf fi +if [ "$SWAN_VER" = "3.28" ]; then + sed -i "/ikev2=never/d" /etc/ipsec.conf + sed -i "/dpdaction=clear/a \ ikev2=never" /etc/ipsec.conf +fi + # Restart IPsec service mkdir -p /run/pluto service ipsec restart