summaryrefslogtreecommitdiffhomepage
path: root/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network
diff options
context:
space:
mode:
authordanrl <mail@danrl.com>2016-11-15 23:57:23 +0100
committerdanrl <mail@danrl.com>2016-11-15 23:57:23 +0100
commiteb44a58c6d54e268678ab631e1cebb6ef8c7adba (patch)
tree0cf0bc756cf3e8f9a119ad3d3832f5e8e8b06e4d /protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network
parentbcd0e1ac0455fe3e5a962ce59d885459f0c2cf07 (diff)
luci-proto-wireguard: input validation optimization
Diffstat (limited to 'protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network')
-rw-r--r--protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua8
1 files changed, 4 insertions, 4 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 e088881293..4cda94c7d0 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 = "and(minlength(44),maxlength(44))"
+private_key.datatype = "rangelength(44, 44)"
private_key.optional = false
@@ -70,7 +70,7 @@ preshared_key = section:taboption(
"cryptography for post-quantum resistance.")
)
preshared_key.password = true
-preshared_key.datatype = "and(minlength(44),maxlength(44))"
+preshared_key.datatype = "rangelength(44, 44)"
preshared_key.optional = true
@@ -94,7 +94,7 @@ public_key = peers:option(
translate("Public Key"),
translate("Required. Public key of peer.")
)
-public_key.datatype = "and(minlength(44),maxlength(44))"
+public_key.datatype = "rangelength(44, 44)"
public_key.optional = false
@@ -105,7 +105,7 @@ allowed_ips = peers:option(
translate("Required. IP addresses and prefixes that this peer is allowed " ..
"to use inside the tunnel. Routes will be added accordingly.")
)
-allowed_ips.datatype = "or(ip6addr, ip4addr)"
+allowed_ips.datatype = "ipaddr"
allowed_ips.optional = false