diff --git a/libs/angular/src/services/jslib-services.module.ts b/libs/angular/src/services/jslib-services.module.ts index 391c20b30d6..263b8d8346d 100644 --- a/libs/angular/src/services/jslib-services.module.ts +++ b/libs/angular/src/services/jslib-services.module.ts @@ -1023,6 +1023,7 @@ const safeProviders: SafeProvider[] = [ KeyGenerationServiceAbstraction, EncryptService, LogService, + CryptoFunctionServiceAbstraction, ], }), safeProvider({ diff --git a/libs/common/src/key-management/master-password/services/fake-master-password.service.ts b/libs/common/src/key-management/master-password/services/fake-master-password.service.ts index 73611bbdc1b..40cbeda2ff1 100644 --- a/libs/common/src/key-management/master-password/services/fake-master-password.service.ts +++ b/libs/common/src/key-management/master-password/services/fake-master-password.service.ts @@ -3,11 +3,20 @@ import { mock } from "jest-mock-extended"; import { ReplaySubject, Observable } from "rxjs"; +// FIXME: Update this file to be type safe and remove this and next line +// eslint-disable-next-line no-restricted-imports +import { KdfConfig } from "@bitwarden/key-management"; + import { ForceSetPasswordReason } from "../../../auth/models/domain/force-set-password-reason"; import { EncString } from "../../../platform/models/domain/enc-string"; import { UserId } from "../../../types/guid"; import { MasterKey, UserKey } from "../../../types/key"; import { InternalMasterPasswordServiceAbstraction } from "../abstractions/master-password.service.abstraction"; +import { + MasterKeyWrappedUserKey, + MasterPasswordAuthenticationData, + MasterPasswordUnlockData, +} from "../types/master-password.types"; export class FakeMasterPasswordService implements InternalMasterPasswordServiceAbstraction { mock = mock(); @@ -71,4 +80,38 @@ export class FakeMasterPasswordService implements InternalMasterPasswordServiceA ): Promise { return this.mock.decryptUserKeyWithMasterKey(masterKey, userId, userKey); } + + makeMasterPasswordAuthenticationData( + password: string, + kdf: KdfConfig, + salt: string, + userId: UserId, + ): Promise { + return this.mock.makeMasterPasswordAuthenticationData(password, kdf, salt, userId); + } + + makeMasterPasswordUnlockData( + password: string, + kdf: KdfConfig, + salt: string, + userKey: UserKey, + ): Promise { + return this.mock.makeMasterPasswordUnlockData(password, kdf, salt, userKey); + } + + makeMasterKeyWrappedUserKey( + password: string, + kdf: KdfConfig, + salt: string, + userKey: UserKey, + ): Promise { + return this.mock.makeMasterKeyWrappedUserKey(password, kdf, salt, userKey); + } + + unwrapMasterKeyWrappedUserKey( + password: string, + masterPasswordUnlockData: MasterPasswordUnlockData, + ): Promise { + return this.mock.unwrapMasterKeyWrappedUserKey(password, masterPasswordUnlockData); + } }