From: Florian Eckert Date: Tue, 12 May 2020 12:45:47 +0000 (+0200) Subject: luci-proto-wireguard: verify last base64 string symbol is an = sign X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=refs%2Fpull%2F4047%2Fhead;p=oweals%2Fluci.git luci-proto-wireguard: verify last base64 string symbol is an = sign Signed-off-by: Florian Eckert --- 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 49f61c782..e88c07c33 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; }