Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
utf8 encode params for key derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Spearrin committed Feb 16, 2017
1 parent f0d440d commit 3ed69d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitwarden",
"version": "1.9.0",
"version": "1.9.1",
"production": true,
"devDependencies": {
"connect": "3.4.1",
Expand Down
5 changes: 3 additions & 2 deletions src/app/services/cryptoService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/settings.js
Original file line number Diff line number Diff line change
@@ -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"});

0 comments on commit 3ed69d8

Please sign in to comment.