luci-proto-wireguard: verify last base64 string symbol is an = sign
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
parent
59bc317326
commit
dae15b8cf4
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue