1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00

remakeEncKey when changing password/email

This commit is contained in:
Kyle Spearrin 2018-08-27 19:09:26 -04:00
parent 4a815b0bdf
commit 85c3056223
3 changed files with 5 additions and 7 deletions

2
jslib

@ -1 +1 @@
Subproject commit 6f43b73237fc64394441d5821bd88090b26cbe5b
Subproject commit 00562d083b687fb566b09c0df8a05e90b86f9e5a

View File

@ -57,9 +57,8 @@ export class ChangeEmailComponent {
const kdfIterations = await this.userService.getKdfIterations();
const newKey = await this.cryptoService.makeKey(this.masterPassword, this.newEmail, kdf, kdfIterations);
request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, newKey);
const encKey = await this.cryptoService.getEncKey();
const newEncKey = await this.cryptoService.encrypt(encKey.key, newKey);
request.key = newEncKey.encryptedString;
const newEncKey = await this.cryptoService.remakeEncKey(newKey);
request.key = newEncKey[1].encryptedString;
try {
this.formPromise = this.apiService.postEmail(request);
await this.formPromise;

View File

@ -58,9 +58,8 @@ export class ChangePasswordComponent {
const kdfIterations = await this.userService.getKdfIterations();
const newKey = await this.cryptoService.makeKey(this.newMasterPassword, email, kdf, kdfIterations);
request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.newMasterPassword, newKey);
const encKey = await this.cryptoService.getEncKey();
const newEncKey = await this.cryptoService.encrypt(encKey.key, newKey);
request.key = newEncKey.encryptedString;
const newEncKey = await this.cryptoService.remakeEncKey(newKey);
request.key = newEncKey[1].encryptedString;
try {
this.formPromise = this.apiService.postPassword(request);
await this.formPromise;