summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2017-02-15 11:09:17 +0200
committerGitHub <noreply@github.com>2017-02-15 11:09:17 +0200
commitdea880ef7229a846b60ffcb98931cb4d58afe8ea (patch)
tree592b4000016101ae1499719ab6f96e8e72675abe
parent3d4fbc9a86db55a4972c49e71096f7af0eb67421 (diff)
parent8fc55591b9adb10c17b506a2e2d178055d07cba7 (diff)
Merge pull request #1015 from danrl/proto-wireguard
luci-proto-wireguard: stricter input validation
-rw-r--r--protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua b/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua
index de4ece347..d95008119 100644
--- a/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua
+++ b/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua
@@ -19,7 +19,7 @@ private_key = section:taboption(
translate("Required. Base64-encoded private key for this interface.")
)
private_key.password = true
-private_key.datatype = "rangelength(44, 44)"
+private_key.datatype = "and(base64,rangelength(44, 44))"
private_key.optional = false
@@ -76,11 +76,12 @@ preshared_key = section:taboption(
Value,
"preshared_key",
translate("Preshared Key"),
- translate("Optional. Adds in an additional layer of symmetric-key " ..
+ translate("Optional. Base64-encoded preshared key. " ..
+ "Adds in an additional layer of symmetric-key " ..
"cryptography for post-quantum resistance.")
)
preshared_key.password = true
-preshared_key.datatype = "rangelength(44, 44)"
+preshared_key.datatype = "and(base64,rangelength(44, 44))"
preshared_key.optional = true
@@ -102,9 +103,9 @@ public_key = peers:option(
Value,
"public_key",
translate("Public Key"),
- translate("Required. Public key of peer.")
+ translate("Required. Base64-encoded public key of peer.")
)
-public_key.datatype = "rangelength(44, 44)"
+public_key.datatype = "and(base64,rangelength(44, 44))"
public_key.optional = false