mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
remakeEncKey when changing password/email
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 6f43b73237...00562d083b
@@ -57,9 +57,8 @@ export class ChangeEmailComponent {
|
|||||||
const kdfIterations = await this.userService.getKdfIterations();
|
const kdfIterations = await this.userService.getKdfIterations();
|
||||||
const newKey = await this.cryptoService.makeKey(this.masterPassword, this.newEmail, kdf, kdfIterations);
|
const newKey = await this.cryptoService.makeKey(this.masterPassword, this.newEmail, kdf, kdfIterations);
|
||||||
request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, newKey);
|
request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, newKey);
|
||||||
const encKey = await this.cryptoService.getEncKey();
|
const newEncKey = await this.cryptoService.remakeEncKey(newKey);
|
||||||
const newEncKey = await this.cryptoService.encrypt(encKey.key, newKey);
|
request.key = newEncKey[1].encryptedString;
|
||||||
request.key = newEncKey.encryptedString;
|
|
||||||
try {
|
try {
|
||||||
this.formPromise = this.apiService.postEmail(request);
|
this.formPromise = this.apiService.postEmail(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
|
|||||||
@@ -58,9 +58,8 @@ export class ChangePasswordComponent {
|
|||||||
const kdfIterations = await this.userService.getKdfIterations();
|
const kdfIterations = await this.userService.getKdfIterations();
|
||||||
const newKey = await this.cryptoService.makeKey(this.newMasterPassword, email, kdf, kdfIterations);
|
const newKey = await this.cryptoService.makeKey(this.newMasterPassword, email, kdf, kdfIterations);
|
||||||
request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.newMasterPassword, newKey);
|
request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.newMasterPassword, newKey);
|
||||||
const encKey = await this.cryptoService.getEncKey();
|
const newEncKey = await this.cryptoService.remakeEncKey(newKey);
|
||||||
const newEncKey = await this.cryptoService.encrypt(encKey.key, newKey);
|
request.key = newEncKey[1].encryptedString;
|
||||||
request.key = newEncKey.encryptedString;
|
|
||||||
try {
|
try {
|
||||||
this.formPromise = this.apiService.postPassword(request);
|
this.formPromise = this.apiService.postPassword(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
|
|||||||
Reference in New Issue
Block a user