mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +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:
@@ -136,14 +136,22 @@ export class NativeMessagingService {
|
||||
});
|
||||
}
|
||||
|
||||
const key = await this.cryptoService.getUserKeyFromStorage(
|
||||
const userKey = await this.cryptoService.getUserKeyFromStorage(
|
||||
KeySuffixOptions.Biometric,
|
||||
message.userId
|
||||
);
|
||||
const masterKey = await this.cryptoService.getMasterKey(message.userId);
|
||||
|
||||
if (key != null) {
|
||||
if (userKey != null) {
|
||||
// we send the master key still for backwards compatibility
|
||||
// with older browser extensions
|
||||
this.send(
|
||||
{ command: "biometricUnlock", response: "unlocked", keyB64: key.keyB64 },
|
||||
{
|
||||
command: "biometricUnlock",
|
||||
response: "unlocked",
|
||||
keyB64: masterKey.keyB64,
|
||||
userKeyB64: userKey.keyB64,
|
||||
},
|
||||
appId
|
||||
);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user