mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +00:00
utf8 encode params for key derivation
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "__MSG_extName__",
|
"name": "__MSG_extName__",
|
||||||
"short_name": "__MSG_appName__",
|
"short_name": "__MSG_appName__",
|
||||||
"version": "1.9.2",
|
"version": "1.9.3",
|
||||||
"description": "__MSG_extDesc__",
|
"description": "__MSG_extDesc__",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"author": "8bit Solutions LLC",
|
"author": "8bit Solutions LLC",
|
||||||
|
|||||||
@@ -207,7 +207,8 @@ function initCryptoService() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
CryptoService.prototype.makeKey = function (password, salt, b64) {
|
CryptoService.prototype.makeKey = function (password, salt, b64) {
|
||||||
var key = forge.pbkdf2(password, salt, 5000, 256 / 8, 'sha256');
|
var key = forge.pbkdf2(forge.util.encodeUtf8(password), forge.util.encodeUtf8(salt),
|
||||||
|
5000, 256 / 8, 'sha256');
|
||||||
|
|
||||||
if (b64 && b64 === true) {
|
if (b64 && b64 === true) {
|
||||||
return forge.util.encode64(key);
|
return forge.util.encode64(key);
|
||||||
@@ -226,7 +227,7 @@ function initCryptoService() {
|
|||||||
throw 'Invalid parameters.';
|
throw 'Invalid parameters.';
|
||||||
}
|
}
|
||||||
|
|
||||||
var hashBits = forge.pbkdf2(key, password, 1, 256 / 8, 'sha256');
|
var hashBits = forge.pbkdf2(key, forge.util.encodeUtf8(password), 1, 256 / 8, 'sha256');
|
||||||
callback(forge.util.encode64(hashBits));
|
callback(forge.util.encode64(hashBits));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user