Merge pull request #1160 from zx2c4/wg-psk-change
wireguard: preshared-key is now an attribute of the peer
This commit is contained in:
commit
7deb3abbad
2 changed files with 21 additions and 23 deletions
|
@ -17,22 +17,22 @@
|
||||||
data[line[1]] = {
|
data[line[1]] = {
|
||||||
name = line[1],
|
name = line[1],
|
||||||
public_key = line[3],
|
public_key = line[3],
|
||||||
listen_port = line[5],
|
listen_port = line[4],
|
||||||
fwmark = line[6],
|
fwmark = line[5],
|
||||||
peers = { }
|
peers = { }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
local peer = {
|
local peer = {
|
||||||
public_key = line[2],
|
public_key = line[2],
|
||||||
endpoint = line[3],
|
endpoint = line[4],
|
||||||
allowed_ips = { },
|
allowed_ips = { },
|
||||||
latest_handshake = line[5],
|
latest_handshake = line[6],
|
||||||
transfer_rx = line[6],
|
transfer_rx = line[7],
|
||||||
transfer_tx = line[7],
|
transfer_tx = line[8],
|
||||||
persistent_keepalive = line[8]
|
persistent_keepalive = line[9]
|
||||||
}
|
}
|
||||||
if not (line[4] == '(none)') then
|
if not (line[4] == '(none)') then
|
||||||
for ipkey, ipvalue in pairs(string.split(line[4], ",")) do
|
for ipkey, ipvalue in pairs(string.split(line[5], ",")) do
|
||||||
if #ipvalue > 0 then
|
if #ipvalue > 0 then
|
||||||
table.insert(peer['allowed_ips'], ipvalue)
|
table.insert(peer['allowed_ips'], ipvalue)
|
||||||
end
|
end
|
||||||
|
|
|
@ -70,21 +70,6 @@ mtu.datatype = "range(1280,1420)"
|
||||||
mtu.placeholder = "1420"
|
mtu.placeholder = "1420"
|
||||||
mtu.optional = true
|
mtu.optional = true
|
||||||
|
|
||||||
|
|
||||||
preshared_key = section:taboption(
|
|
||||||
"advanced",
|
|
||||||
Value,
|
|
||||||
"preshared_key",
|
|
||||||
translate("Preshared 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 = "and(base64,rangelength(44,44))"
|
|
||||||
preshared_key.optional = true
|
|
||||||
|
|
||||||
|
|
||||||
fwmark = section:taboption(
|
fwmark = section:taboption(
|
||||||
"advanced",
|
"advanced",
|
||||||
Value,
|
Value,
|
||||||
|
@ -121,6 +106,19 @@ public_key.datatype = "and(base64,rangelength(44,44))"
|
||||||
public_key.optional = false
|
public_key.optional = false
|
||||||
|
|
||||||
|
|
||||||
|
preshared_key = peers:option(
|
||||||
|
Value,
|
||||||
|
"preshared_key",
|
||||||
|
translate("Preshared 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 = "and(base64,rangelength(44,44))"
|
||||||
|
preshared_key.optional = true
|
||||||
|
|
||||||
|
|
||||||
allowed_ips = peers:option(
|
allowed_ips = peers:option(
|
||||||
DynamicList,
|
DynamicList,
|
||||||
"allowed_ips",
|
"allowed_ips",
|
||||||
|
|
Loading…
Reference in a new issue