From 3ed69d887f614cf5141ff5ffb6f90df056bc4e5b Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 15 Feb 2017 19:03:56 -0500 Subject: [PATCH] utf8 encode params for key derivation --- package.json | 2 +- src/app/services/cryptoService.js | 5 +++-- src/app/settings.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1c889fb1d7..5d7b4d8fe2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitwarden", - "version": "1.9.0", + "version": "1.9.1", "production": true, "devDependencies": { "connect": "3.4.1", diff --git a/src/app/services/cryptoService.js b/src/app/services/cryptoService.js index c7b40c6991..c6974ab4de 100644 --- a/src/app/services/cryptoService.js +++ b/src/app/services/cryptoService.js @@ -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); }; diff --git a/src/app/settings.js b/src/app/settings.js index 43c32102f6..00329f52c1 100644 --- a/src/app/settings.js +++ b/src/app/settings.js @@ -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"});