1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-22611] Require userid for masterKey methods on the key service (#15663)

* Require userId on targeted methods.

* update method consumers

* unit tests
This commit is contained in:
Thomas Avery
2025-07-25 09:37:04 -05:00
committed by GitHub
parent b358d5663d
commit 2db31d1228
6 changed files with 233 additions and 88 deletions

View File

@@ -428,7 +428,8 @@ export class LoginCommand {
);
const request = new PasswordRequest();
request.masterPasswordHash = await this.keyService.hashMasterKey(currentPassword, null);
const masterKey = await this.keyService.getOrDeriveMasterKey(currentPassword, userId);
request.masterPasswordHash = await this.keyService.hashMasterKey(currentPassword, masterKey);
request.masterPasswordHint = hint;
request.newMasterPasswordHash = newPasswordHash;
request.key = newUserKey[1].encryptedString;