diff options
author | kali <kali@leap.se> | 2020-07-27 18:18:38 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2020-10-13 19:08:40 +0200 |
commit | 2cf32806dcce2d41920be28bd0e7d12e5d049357 (patch) | |
tree | 5ecad10f0c2804ab0ded8380431490e475f57998 /pkg/helper/args.go | |
parent | 211fc457329b074fd4331aec0c4fc5d765e9023f (diff) |
[pkg] update build script for openvpn
Diffstat (limited to 'pkg/helper/args.go')
-rw-r--r-- | pkg/helper/args.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pkg/helper/args.go b/pkg/helper/args.go index 1a5bd3b..5a7873f 100644 --- a/pkg/helper/args.go +++ b/pkg/helper/args.go @@ -6,6 +6,7 @@ import ( "os" "regexp" "strconv" + "path/filepath" ) const ( @@ -22,11 +23,11 @@ var ( "--tls-client", "--remote-cert-tls", "server", "--dhcp-option", "DNS", nameserver, - "--log", LogFolder + "openvpn.log", "--tls-version-min", "1.0", + "--log", filepath.Join(LogFolder, "openvpn-leap.log"), } - allowendArgs = map[string][]string{ + allowedArgs = map[string][]string{ "--remote": []string{"IP", "NUMBER", "PROTO"}, "--tls-cipher": []string{"CIPHER"}, "--cipher": []string{"CIPHER"}, @@ -44,7 +45,7 @@ var ( cipher = regexp.MustCompile("^[A-Z0-9-]+$") formats = map[string]func(s string) bool{ - "NUMBER": isNumber, + "NUMBER": isNumber, "PROTO": isProto, "IP": isIP, "CIPHER": cipher.MatchString, @@ -54,9 +55,9 @@ var ( func parseOpenvpnArgs(args []string) []string { newArgs := fixedArgs - newArgs = append(newArgs, platformOpenvpnFlags...) + newArgs = append(newArgs, getPlatformOpenvpnFlags()...) for i := 0; i < len(args); i++ { - params, ok := allowendArgs[args[i]] + params, ok := allowedArgs[args[i]] if !ok { log.Printf("Invalid openvpn arg: %s", args[i]) continue |