summaryrefslogtreecommitdiffhomepage
path: root/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2020-05-12 14:45:47 +0200
committerFlorian Eckert <fe@dev.tdt.de>2020-05-14 09:44:50 +0200
commitdae15b8cf476fe761b2b6a7457c4d8e3e9950569 (patch)
tree23dd4ac2ccd19e8164fecfa6f81ce6764fc66fd4 /protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol
parent59bc3173268313bb4546aa1c6da2309da408250d (diff)
luci-proto-wireguard: verify last base64 string symbol is an = sign
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol')
-rw-r--r--protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
index 49f61c782a..e88c07c339 100644
--- a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
+++ b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
@@ -10,6 +10,9 @@ function validateBase64(section_id, value) {
if (value.length != 44 || !value.match(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/))
return _('Invalid Base64 key string');
+ if (value[43] != "=" )
+ return _('Invalid Base64 key string');
+
return true;
}