strongswan: fix PSK config generation 15890/head
authorVincent Wiemann <vincent.wiemann@ironai.com>
Thu, 17 Jun 2021 04:15:34 +0000 (06:15 +0200)
committerVincent Wiemann <vincent.wiemann@ironai.com>
Fri, 18 Jun 2021 02:42:01 +0000 (04:42 +0200)
There were closing curly braces missing and it was checking for empty
strings while it should have been checking for non-empty strings.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
net/strongswan/Makefile
net/strongswan/files/swanctl.init

index 70f1e8e6f09f5db7fb12867eee4ed71a5ac329ae..596bd8e385a642a6ec33c2b39064d2d69ea954b2 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=strongswan
 PKG_VERSION:=5.9.2
-PKG_RELEASE:=10
+PKG_RELEASE:=11
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://download.strongswan.org/ https://download2.strongswan.org/
index 41d7dd5a24f2271de8c5047e79ee5a18e73ccd14..884fefe388c55a7562ba38493876c1df14055a37 100644 (file)
@@ -486,12 +486,14 @@ config_remote() {
                swanctl_xappend0 "secrets {"
                swanctl_xappend1 "ike {"
                swanctl_xappend2 "secret = $pre_shared_key"
-               if [ -z "$local_id" ]; then
+               if [ -n "$local_id" ]; then
                        swanctl_xappend2 "id1 = $local_id"
-                       if [ -z "$remote_id" ]; then
+                       if [ -n "$remote_id" ]; then
                                swanctl_xappend2 "id2 = $remote_id"
                        fi
                fi
+               swanctl_xappend1 "}"
+               swanctl_xappend0 "}"
        else
                fatal "AuthenticationMode $auth_mode not supported"
        fi