1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-25 17:32:46 +01:00

utf8 encode params for key derivation

This commit is contained in:
Kyle Spearrin 2017-02-15 19:03:56 -05:00
parent f0d440d204
commit 3ed69d887f
3 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "bitwarden",
"version": "1.9.0",
"version": "1.9.1",
"production": true,
"devDependencies": {
"connect": "3.4.1",

View File

@ -52,7 +52,8 @@ angular
};
_service.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) {
return forge.util.encode64(key);
@ -70,7 +71,7 @@ angular
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');
return forge.util.encode64(hashBits);
};

View File

@ -1,2 +1,2 @@
angular.module("bit")
.constant("appSettings", {"rememberedEmailCookieName":"bit.rememberedEmail","apiUri":"https://api.bitwarden.com","version":"1.9.0","environment":"Production"});
.constant("appSettings", {"rememberedEmailCookieName":"bit.rememberedEmail","apiUri":"https://api.bitwarden.com","version":"1.9.1","environment":"Production"});