1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 05:13:29 +00:00

[PM-2192] Improve userkey verification on biometric unlock (#10326)

* Improve biometric unlock userkey verification

* Add early return

* Pass activeuserid to cryptoservice functions
This commit is contained in:
Bernd Schoolmann
2024-08-06 21:35:04 +02:00
committed by GitHub
parent b84becd9e4
commit 7cd6fcf265
5 changed files with 48 additions and 18 deletions

View File

@@ -418,4 +418,11 @@ export abstract class CryptoService {
* @throws If an invalid user id is passed in.
*/
abstract userPublicKey$(userId: UserId): Observable<UserPublicKey>;
/**
* Validates that a userkey is correct for a given user
* @param key The key to validate
* @param userId The user id for the key
*/
abstract validateUserKey(key: UserKey, userId: UserId): Promise<boolean>;
}

View File

@@ -620,7 +620,7 @@ export class CryptoService implements CryptoServiceAbstraction {
}
// ---HELPERS---
protected async validateUserKey(key: UserKey, userId: UserId): Promise<boolean> {
async validateUserKey(key: UserKey, userId: UserId): Promise<boolean> {
if (!key) {
return false;
}