Skip to content
This repository has been archived by the owner on Sep 3, 2019. It is now read-only.

Commit

Permalink
have scryptWebWorker send back passwordHash instead of derivedKey, th…
Browse files Browse the repository at this point in the history
…is resolves the problem where upversioning from 1.2.1->1.3.1 would cause an invalid password error without a reinstall (#157)
  • Loading branch information
soshochang authored Sep 15, 2018
1 parent 1070e23 commit 6693ca9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/background/controllers/cryptoController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ export default class CryptoController extends IController {
if (e.data.err) {
throw Error('scrypt failed to calculate derivedKey');
}
const derivedKey = e.data.derivedKey;
this.passwordHash = derivedKey.toString('hex');
this.passwordHash = e.data.passwordHash;
this.main.account.finishLogin();
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/background/workers/scryptworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ onmessage = (e) => {
const saltBuffer = Buffer.from(salt);
const { N, r, p } = e.data.scryptParams;
const derivedKey = scrypt(password, saltBuffer, N, r, p, 64);
postMessage({ derivedKey });
const passwordHash = derivedKey.toString('hex');
postMessage({ passwordHash });
} catch (err) {
postMessage({ err });
}
Expand Down
2 changes: 1 addition & 1 deletion static/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Qrypto",
"description": "Qtum light wallet and transaction signing client.",
"version": "1.3.1",
"version": "1.3.2",
"manifest_version": 2,
"icons": {
"16": "images/logo-main-16.png",
Expand Down

0 comments on commit 6693ca9

Please sign in to comment.