1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-21 21:11:35 +01:00
This commit is contained in:
Jacob Fink 2023-07-06 12:51:31 -04:00
parent 160ca2cd3b
commit 7a25c376ce
No known key found for this signature in database
GPG Key ID: C2F7ACF05859D008

View File

@ -45,12 +45,12 @@ export class UnlockCommand {
const kdf = await this.stateService.getKdfType();
const kdfConfig = await this.stateService.getKdfConfig();
const masterKey = await this.cryptoService.makeMasterKey(password, email, kdf, kdfConfig);
const storedKeyHash = await this.cryptoService.getKeyHash();
const storedKeyHash = await this.cryptoService.getPasswordHash();
let passwordValid = false;
if (masterKey != null) {
if (storedKeyHash != null) {
passwordValid = await this.cryptoService.compareAndUpdateKeyHash(password, masterKey);
passwordValid = await this.cryptoService.compareAndUpdatePasswordHash(password, masterKey);
} else {
const serverKeyHash = await this.cryptoService.hashPassword(
password,
@ -67,7 +67,7 @@ export class UnlockCommand {
masterKey,
HashPurpose.LocalAuthorization
);
await this.cryptoService.setKeyHash(localKeyHash);
await this.cryptoService.setPasswordHash(localKeyHash);
} catch {
// Ignore
}