aboutsummaryrefslogtreecommitdiff
path: root/net/openconnect
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2019-09-20 09:22:54 +0000
committerYousong Zhou <yszhou4tech@gmail.com>2019-09-21 10:33:18 +0000
commit384398d452180aaeb39c3163d172990fc7359c3a (patch)
tree92f89fb2f54818e4d55fd5632f033fadc751e099 /net/openconnect
parent61423689f9d09c56dd0e6c5fc34e7a2449d1dd7b (diff)
openconnect: allow specifying form_entry list
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'net/openconnect')
-rw-r--r--net/openconnect/Makefile2
-rw-r--r--net/openconnect/README3
-rwxr-xr-xnet/openconnect/files/openconnect.sh9
3 files changed, 12 insertions, 2 deletions
diff --git a/net/openconnect/Makefile b/net/openconnect/Makefile
index 70454a4fd..0d90c2b77 100644
--- a/net/openconnect/Makefile
+++ b/net/openconnect/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=openconnect
PKG_VERSION:=8.04
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/
diff --git a/net/openconnect/README b/net/openconnect/README
index 019058ce5..29c807490 100644
--- a/net/openconnect/README
+++ b/net/openconnect/README
@@ -33,6 +33,9 @@ config interface 'MYVPN'
# Juniper vpn support
#option juniper '1'
+ # Authentication form responses
+ #list form_entry FORM:OPT=VAL
+
The additional files are also used:
/etc/openconnect/user-cert-vpn-MYVPN.pem: The user certificate
/etc/openconnect/user-key-vpn-MYVPN.pem: The user private key
diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh
index dc1d42b80..15bd3b5a5 100755
--- a/net/openconnect/files/openconnect.sh
+++ b/net/openconnect/files/openconnect.sh
@@ -19,14 +19,19 @@ proto_openconnect_init_config() {
proto_config_add_string "token_script"
proto_config_add_string "os"
proto_config_add_string "csd_wrapper"
+ proto_config_add_array 'form_entry:regex("[^:]+:[^=]+=.*")'
no_device=1
available=1
}
+proto_openconnect_add_form_entry() {
+ [ -n "$1" ] && append cmdline "--form-entry $1"
+}
+
proto_openconnect_setup() {
local config="$1"
- json_get_vars server port interface username serverhash authgroup password password2 token_mode token_secret token_script os csd_wrapper mtu juniper
+ json_get_vars server port interface username serverhash authgroup password password2 token_mode token_secret token_script os csd_wrapper mtu juniper form_entry
grep -q tun /proc/modules || insmod tun
ifname="vpn-$config"
@@ -88,6 +93,8 @@ proto_openconnect_setup() {
[ -n "$os" ] && append cmdline "--os=$os"
[ -n "$csd_wrapper" ] && [ -x "$csd_wrapper" ] && append cmdline "--csd-wrapper=$csd_wrapper"
+ json_for_each_item proto_openconnect_add_form_entry form_entry
+
proto_export INTERFACE="$config"
logger -t openconnect "executing 'openconnect $cmdline'"