1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00: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

Submodule jslib updated: 6f43b73237...00562d083b

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;