mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
migrate native messaging for biometrics to use new key model
- support backwards compatibility - update safari web extension to send user key - add error handling
This commit is contained in:
@@ -739,10 +739,12 @@ export class CryptoService implements CryptoServiceAbstraction {
|
||||
keySuffix: KeySuffixOptions,
|
||||
userId?: string
|
||||
): Promise<UserSymKey> {
|
||||
if (keySuffix === KeySuffixOptions.Pin) {
|
||||
if (keySuffix === KeySuffixOptions.Auto) {
|
||||
await this.migrateAutoKeyIfNeeded(userId);
|
||||
const userKey = await this.stateService.getUserSymKeyAuto({ userId: userId });
|
||||
return new SymmetricCryptoKey(Utils.fromB64ToArray(userKey).buffer) as UserSymKey;
|
||||
if (userKey) {
|
||||
return new SymmetricCryptoKey(Utils.fromB64ToArray(userKey).buffer) as UserSymKey;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user