From a8105af8290ba4f4cd8824d38464b1441c6c4d35 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Tue, 22 Jul 2025 13:41:38 +0200 Subject: [PATCH] Cleanup --- .../services/master-password.service.spec.ts | 14 ++------------ .../services/master-password.service.ts | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/libs/common/src/key-management/master-password/services/master-password.service.spec.ts b/libs/common/src/key-management/master-password/services/master-password.service.spec.ts index 9baf5241162..39fe79f89a4 100644 --- a/libs/common/src/key-management/master-password/services/master-password.service.spec.ts +++ b/libs/common/src/key-management/master-password/services/master-password.service.spec.ts @@ -5,13 +5,9 @@ import * as rxjs from "rxjs"; import { SdkLoadService } from "@bitwarden/common/platform/abstractions/sdk/sdk-load.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; // eslint-disable-next-line no-restricted-imports -import { KdfConfig, KdfConfigService, PBKDF2KdfConfig } from "@bitwarden/key-management"; +import { KdfConfig, PBKDF2KdfConfig } from "@bitwarden/key-management"; -import { - FakeAccountService, - makeSymmetricCryptoKey, - mockAccountServiceWith, -} from "../../../../spec"; +import { makeSymmetricCryptoKey } from "../../../../spec"; import { ForceSetPasswordReason } from "../../../auth/models/domain/force-set-password-reason"; import { KeyGenerationService } from "../../../platform/abstractions/key-generation.service"; import { LogService } from "../../../platform/abstractions/log.service"; @@ -36,8 +32,6 @@ describe("MasterPasswordService", () => { let encryptService: MockProxy; let logService: MockProxy; let cryptoFunctionService: MockProxy; - let kdfConfigService: MockProxy; - let accountService: FakeAccountService; const userId = "user-id" as UserId; const mockUserState = { @@ -60,8 +54,6 @@ describe("MasterPasswordService", () => { encryptService = mock(); logService = mock(); cryptoFunctionService = mock(); - kdfConfigService = mock(); - accountService = mockAccountServiceWith(userId); stateProvider.getUser.mockReturnValue(mockUserState as any); @@ -74,8 +66,6 @@ describe("MasterPasswordService", () => { encryptService, logService, cryptoFunctionService, - kdfConfigService, - accountService, ); encryptService.unwrapSymmetricKey.mockResolvedValue(makeSymmetricCryptoKey(64, 1)); diff --git a/libs/common/src/key-management/master-password/services/master-password.service.ts b/libs/common/src/key-management/master-password/services/master-password.service.ts index ac8a817d9e1..6f2d8689221 100644 --- a/libs/common/src/key-management/master-password/services/master-password.service.ts +++ b/libs/common/src/key-management/master-password/services/master-password.service.ts @@ -310,7 +310,7 @@ export class MasterPasswordService implements InternalMasterPasswordServiceAbstr await SdkLoadService.Ready; const userKey = new SymmetricCryptoKey( PureCrypto.decrypt_user_key_with_master_password( - masterPasswordUnlockData.masterKeyWrappedUserKey!.encryptedString, + masterPasswordUnlockData.masterKeyWrappedUserKey.encryptedString, password, masterPasswordUnlockData.salt, masterPasswordUnlockData.kdf.toSdkConfig(),