projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
luci-proto-wireguard: stricter input validation
[project/luci.git]
/
protocols
/
luci-proto-wireguard
/
luasrc
/
model
/
cbi
/
admin_network
/
proto_wireguard.lua
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
774c6db
..
d950081
100644
(file)
--- 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
@@
-1,4
+1,4
@@
--- Copyright 2016 Dan Luedtke <mail@danrl.com>
+-- Copyright 2016
-2017
Dan Luedtke <mail@danrl.com>
-- Licensed to the public under the Apache License 2.0.
-- Licensed to the public under the Apache License 2.0.
@@
-19,7
+19,7
@@
private_key = section:taboption(
translate("Required. Base64-encoded private key for this interface.")
)
private_key.password = true
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
private_key.optional = false
@@
-34,6
+34,16
@@
listen_port.datatype = "port"
listen_port.placeholder = "51820"
listen_port.optional = true
listen_port.placeholder = "51820"
listen_port.optional = true
+addresses = section:taboption(
+ "general",
+ DynamicList,
+ "addresses",
+ translate("IP Addresses"),
+ translate("Recommended. IP addresses of the WireGuard interface.")
+)
+addresses.datatype = "ipaddr"
+addresses.optional = true
+
-- advanced --------------------------------------------------------------------
-- advanced --------------------------------------------------------------------
@@
-56,8
+66,8
@@
mtu = section:taboption(
translate("MTU"),
translate("Optional. Maximum Transmission Unit of tunnel interface.")
)
translate("MTU"),
translate("Optional. Maximum Transmission Unit of tunnel interface.")
)
-mtu.datatype = "range(1280,142
3
)"
-mtu.placeholder = "142
3
"
+mtu.datatype = "range(1280,142
0
)"
+mtu.placeholder = "142
0
"
mtu.optional = true
mtu.optional = true
@@
-66,11
+76,12
@@
preshared_key = section:taboption(
Value,
"preshared_key",
translate("Preshared Key"),
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
"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
preshared_key.optional = true
@@
-92,9
+103,9
@@
public_key = peers:option(
Value,
"public_key",
translate("Public Key"),
Value,
"public_key",
translate("Public Key"),
- translate("Required.
P
ublic key of peer.")
+ translate("Required.
Base64-encoded p
ublic key of peer.")
)
)
-public_key.datatype = "
rangelength(44, 44
)"
+public_key.datatype = "
and(base64,rangelength(44, 44)
)"
public_key.optional = false
public_key.optional = false