mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-18 01:41:27 +01:00
move biometric check to electron crypto service
This commit is contained in:
parent
71ebb17a56
commit
3f496f8fb0
@ -61,6 +61,14 @@ export class ElectronCryptoService extends CryptoService {
|
||||
);
|
||||
}
|
||||
|
||||
protected async shouldStoreKey(keySuffix: KeySuffixOptions, userId?: string): Promise<boolean> {
|
||||
if (keySuffix === KeySuffixOptions.Biometric) {
|
||||
const biometricUnlock = await this.stateService.getBiometricUnlock({ userId: userId });
|
||||
return biometricUnlock && this.platformUtilService.supportsSecureStorage();
|
||||
}
|
||||
return await super.shouldStoreKey(keySuffix, userId);
|
||||
}
|
||||
|
||||
private async getBiometricEncryptionClientKeyHalf(userId?: string): Promise<CsprngString | null> {
|
||||
try {
|
||||
let biometricKey = await this.stateService
|
||||
|
@ -734,11 +734,6 @@ export class CryptoService implements CryptoServiceAbstraction {
|
||||
shouldStoreKey = vaultTimeout == null;
|
||||
break;
|
||||
}
|
||||
case KeySuffixOptions.Biometric: {
|
||||
const biometricUnlock = await this.stateService.getBiometricUnlock({ userId: userId });
|
||||
shouldStoreKey = biometricUnlock && this.platformUtilService.supportsSecureStorage();
|
||||
break;
|
||||
}
|
||||
case KeySuffixOptions.Pin: {
|
||||
const protectedPin = await this.stateService.getProtectedPin({ userId: userId });
|
||||
// This could cause a possible timing issue. Need to make sure the ephemeral key is set before
|
||||
|
Loading…
Reference in New Issue
Block a user