mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 434624: Handle "websafe" base64 characters in client keys. r=tony
This commit is contained in:
parent
400dd5d87c
commit
ad00948be1
@ -258,6 +258,11 @@ PROT_UrlCryptoKeyManager.prototype.hasKey = function() {
|
||||
return this.clientKey_ != null && this.wrappedKey_ != null;
|
||||
}
|
||||
|
||||
PROT_UrlCryptoKeyManager.prototype.unUrlSafe = function(key)
|
||||
{
|
||||
return key.replace("-", "+").replace("_", "/");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a new key and serialize it to disk.
|
||||
*
|
||||
@ -273,7 +278,7 @@ PROT_UrlCryptoKeyManager.prototype.replaceKey_ = function(clientKey,
|
||||
G_Debug(this, "Replacing " + this.clientKey_ + " with " + clientKey);
|
||||
|
||||
this.clientKey_ = clientKey;
|
||||
this.clientKeyArray_ = Array.map(atob(clientKey),
|
||||
this.clientKeyArray_ = Array.map(atob(this.unUrlSafe(clientKey)),
|
||||
function(c) { return c.charCodeAt(0); });
|
||||
this.wrappedKey_ = wrappedKey;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user