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: verify last base64 string symbol is an = sign
[project/luci.git]
/
protocols
/
luci-proto-wireguard
/
htdocs
/
luci-static
/
resources
/
protocol
/
wireguard.js
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 49f61c782a1459a2127f16202b0e905ee7eeb233..e88c07c339ba532f4f319e600fbc9f31d92def6a 100644
(file)
--- 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;
}