From bd0fb024c1aa2a442b7482a11f6cb9aa717ddb9c Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Tue, 15 Jun 2021 13:40:34 -0500 Subject: [PATCH] Always get key from storage to ensure biometric prompt. (#952) * Always get key from storage to ensure biometric prompt. * Update jslib * Update jslib --- jslib | 2 +- src/app/services.module.ts | 5 +++-- src/services/nativeMessaging.service.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/jslib b/jslib index 5ba1416679f..1f83c3c1ba1 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 5ba1416679f112e42e4b5dbd5c47949dcd8d0b56 +Subproject commit 1f83c3c1ba14d2cdbc319ac060a08cc7c0911b5c diff --git a/src/app/services.module.ts b/src/app/services.module.ts index 0aa8d0dee94..bda7379558c 100644 --- a/src/app/services.module.ts +++ b/src/app/services.module.ts @@ -29,7 +29,6 @@ import { CipherService } from 'jslib-common/services/cipher.service'; import { CollectionService } from 'jslib-common/services/collection.service'; import { ConstantsService } from 'jslib-common/services/constants.service'; import { ContainerService } from 'jslib-common/services/container.service'; -import { CryptoService } from 'jslib-common/services/crypto.service'; import { EnvironmentService } from 'jslib-common/services/environment.service'; import { EventService } from 'jslib-common/services/event.service'; import { ExportService } from 'jslib-common/services/export.service'; @@ -51,6 +50,8 @@ import { UserService } from 'jslib-common/services/user.service'; import { VaultTimeoutService } from 'jslib-common/services/vaultTimeout.service'; import { WebCryptoFunctionService } from 'jslib-common/services/webCryptoFunction.service'; +import { ElectronCryptoService } from 'jslib-electron/services/electronCrypto.service'; + import { ApiService as ApiServiceAbstraction } from 'jslib-common/abstractions/api.service'; import { AuditService as AuditServiceAbstraction } from 'jslib-common/abstractions/audit.service'; import { AuthService as AuthServiceAbstraction } from 'jslib-common/abstractions/auth.service'; @@ -96,7 +97,7 @@ const platformUtilsService = new ElectronPlatformUtilsService(i18nService, messa const secureStorageService: StorageServiceAbstraction = new ElectronRendererSecureStorageService(); const cryptoFunctionService: CryptoFunctionServiceAbstraction = new WebCryptoFunctionService(window, platformUtilsService); -const cryptoService = new CryptoService(storageService, secureStorageService, cryptoFunctionService, +const cryptoService = new ElectronCryptoService(storageService, secureStorageService, cryptoFunctionService, platformUtilsService, logService); const tokenService = new TokenService(storageService); const appIdService = new AppIdService(storageService); diff --git a/src/services/nativeMessaging.service.ts b/src/services/nativeMessaging.service.ts index b63f5695dac..117c1be67c8 100644 --- a/src/services/nativeMessaging.service.ts +++ b/src/services/nativeMessaging.service.ts @@ -102,7 +102,7 @@ export class NativeMessagingService { }); } - const keyB64 = await (await this.cryptoService.getKey('biometric')).keyB64; + const keyB64 = await (await this.cryptoService.getKeyFromStorage('biometric')).keyB64; if (keyB64 != null) { this.send({ command: 'biometricUnlock', response: 'unlocked', keyB64: keyB64 }, appId);