Browse Source

Merge pull request #10045 from yousong/oc-form

openconnect: allow specifying form_entry list
lilik-openwrt-22.03
Nikos Mavrogiannopoulos 5 years ago
committed by GitHub
parent
commit
6358c3e72e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions
  1. +1
    -1
      net/openconnect/Makefile
  2. +3
    -0
      net/openconnect/README
  3. +8
    -1
      net/openconnect/files/openconnect.sh

+ 1
- 1
net/openconnect/Makefile View File

@ -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/


+ 3
- 0
net/openconnect/README View File

@ -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


+ 8
- 1
net/openconnect/files/openconnect.sh View File

@ -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'"


Loading…
Cancel
Save