mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-31 22:51:28 +01:00
Check MasterPassword in web app during change (#8293)
This commit is contained in:
parent
7d5575882e
commit
350ad890de
@ -165,7 +165,22 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
|||||||
newMasterKey: MasterKey,
|
newMasterKey: MasterKey,
|
||||||
newUserKey: [UserKey, EncString],
|
newUserKey: [UserKey, EncString],
|
||||||
) {
|
) {
|
||||||
const masterKey = await this.cryptoService.getOrDeriveMasterKey(this.currentMasterPassword);
|
const masterKey = await this.cryptoService.makeMasterKey(
|
||||||
|
this.currentMasterPassword,
|
||||||
|
await this.stateService.getEmail(),
|
||||||
|
await this.kdfConfigService.getKdfConfig(),
|
||||||
|
);
|
||||||
|
|
||||||
|
const userKey = await this.cryptoService.decryptUserKeyWithMasterKey(masterKey);
|
||||||
|
if (userKey == null) {
|
||||||
|
this.platformUtilsService.showToast(
|
||||||
|
"error",
|
||||||
|
null,
|
||||||
|
this.i18nService.t("invalidMasterPassword"),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const request = new PasswordRequest();
|
const request = new PasswordRequest();
|
||||||
request.masterPasswordHash = await this.cryptoService.hashMasterKey(
|
request.masterPasswordHash = await this.cryptoService.hashMasterKey(
|
||||||
this.currentMasterPassword,
|
this.currentMasterPassword,
|
||||||
|
Loading…
Reference in New Issue
Block a user