From c4465b9425b0fe04aec5947301d305e894b1e9c0 Mon Sep 17 00:00:00 2001 From: viktorbarzin Date: Thu, 25 Mar 2021 22:51:54 +0000 Subject: [PATCH] update base64 regex for pub key --- cli/main.go | 2 +- cli/vpn.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/main.go b/cli/main.go index be717bfc..593f16bf 100644 --- a/cli/main.go +++ b/cli/main.go @@ -23,7 +23,7 @@ var ( func main() { err := run() if err != nil { - glog.Fatalf("run failed: %s", err.Error()) + glog.Errorf("run failed: %s", err.Error()) } } diff --git a/cli/vpn.go b/cli/vpn.go index 0dce0615..42158a24 100644 --- a/cli/vpn.go +++ b/cli/vpn.go @@ -22,7 +22,7 @@ const ( var ( allowedClientName = regexp.MustCompile(`^[a-zA-Z0-9 ]+$`) - allowedPubKey = regexp.MustCompile(`^[a-zA-Z0-9=]+$`) + allowedPubKey = regexp.MustCompile(`^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$`) ) // addVPNClient inserts new client config