diff --git a/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.spec.ts b/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.spec.ts index 4b4a22d54aa..f4e68183798 100644 --- a/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.spec.ts +++ b/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.spec.ts @@ -96,10 +96,8 @@ describe("KeyRotationService", () => { const mockTrustedPublicKeys = [Utils.fromUtf8ToArray("test-public-key")]; beforeAll(() => { - jest.spyOn(PureCrypto, "generate_user_key_aes256_cbc_hmac").mockReturnValue(new Uint8Array(64)); - jest - .spyOn(PureCrypto, "generate_user_key_xchacha20_poly1305") - .mockReturnValue(new Uint8Array(70)); + jest.spyOn(PureCrypto, "make_user_key_aes256_cbc_hmac").mockReturnValue(new Uint8Array(64)); + jest.spyOn(PureCrypto, "make_user_key_xchacha20_poly1305").mockReturnValue(new Uint8Array(70)); jest .spyOn(PureCrypto, "encrypt_user_key_with_master_password") .mockReturnValue("mockNewUserKey"); @@ -294,14 +292,14 @@ describe("KeyRotationService", () => { expect(arg.accountUnlockData.emergencyAccessUnlockData.length).toBe(1); expect(arg.accountUnlockData.organizationAccountRecoveryUnlockData.length).toBe(1); expect(arg.accountUnlockData.passkeyUnlockData.length).toBe(2); - expect(PureCrypto.generate_user_key_aes256_cbc_hmac).toHaveBeenCalled(); + expect(PureCrypto.make_user_key_aes256_cbc_hmac).toHaveBeenCalled(); expect(PureCrypto.encrypt_user_key_with_master_password).toHaveBeenCalledWith( new Uint8Array(64), "newMasterPassword", mockUser.email, DEFAULT_KDF_CONFIG.toSdkConfig(), ); - expect(PureCrypto.generate_user_key_xchacha20_poly1305).not.toHaveBeenCalled(); + expect(PureCrypto.make_user_key_xchacha20_poly1305).not.toHaveBeenCalled(); }); it("rotates the userkey to xchacha20poly1305 and encrypted data and changes master password when featureflag is active", async () => { @@ -339,14 +337,14 @@ describe("KeyRotationService", () => { expect(arg.accountUnlockData.emergencyAccessUnlockData.length).toBe(1); expect(arg.accountUnlockData.organizationAccountRecoveryUnlockData.length).toBe(1); expect(arg.accountUnlockData.passkeyUnlockData.length).toBe(2); - expect(PureCrypto.generate_user_key_aes256_cbc_hmac).toHaveBeenCalled(); + expect(PureCrypto.make_user_key_aes256_cbc_hmac).toHaveBeenCalled(); expect(PureCrypto.encrypt_user_key_with_master_password).toHaveBeenCalledWith( new Uint8Array(70), "newMasterPassword", mockUser.email, DEFAULT_KDF_CONFIG.toSdkConfig(), ); - expect(PureCrypto.generate_user_key_xchacha20_poly1305).toHaveBeenCalled(); + expect(PureCrypto.make_user_key_xchacha20_poly1305).toHaveBeenCalled(); }); it("returns early when first trust warning dialog is declined", async () => { diff --git a/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.ts b/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.ts index ea0b2bd8a32..b6c5b7314a1 100644 --- a/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.ts +++ b/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.ts @@ -121,9 +121,9 @@ export class UserKeyRotationService { const newMasterKey = await this.keyService.makeMasterKey(newMasterPassword, email, kdfConfig); - let userKeyBytes = PureCrypto.generate_user_key_aes256_cbc_hmac(); + let userKeyBytes = PureCrypto.make_user_key_aes256_cbc_hmac(); if (await this.configService.getFeatureFlag(FeatureFlag.EnrollAeadOnKeyRotation)) { - userKeyBytes = PureCrypto.generate_user_key_xchacha20_poly1305(); + userKeyBytes = PureCrypto.make_user_key_xchacha20_poly1305(); } const newMasterKeyEncryptedUserKey = new EncString( PureCrypto.encrypt_user_key_with_master_password( diff --git a/package-lock.json b/package-lock.json index cdc94abbb88..13d5bf87bcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "@angular/platform-browser": "18.2.13", "@angular/platform-browser-dynamic": "18.2.13", "@angular/router": "18.2.13", - "@bitwarden/sdk-internal": "0.2.0-main.163", + "@bitwarden/sdk-internal": "0.2.0-main.168", "@electron/fuses": "1.8.0", "@emotion/css": "11.13.5", "@koa/multer": "3.0.2", @@ -4771,9 +4771,9 @@ "link": true }, "node_modules/@bitwarden/sdk-internal": { - "version": "0.2.0-main.163", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-internal/-/sdk-internal-0.2.0-main.163.tgz", - "integrity": "sha512-k8Z4wUhgQi4+vc/Zy3GgRZqxqrCiEzC0M4dRkoieMSU65e/8b0HBy0kXYcrcip2HKIxFZd6hXsv/auIf7fgEFg==", + "version": "0.2.0-main.168", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-internal/-/sdk-internal-0.2.0-main.168.tgz", + "integrity": "sha512-NU10oqw+GI9oHrh8/i/IC8/7oaYmswqC2E/0Zc56xC3jY7uNgFZgpae7JhyMU6UxzrAjiEqdmGnm+AGWFiPG8w==", "license": "GPL-3.0" }, "node_modules/@bitwarden/send-ui": { diff --git a/package.json b/package.json index 8341ac509aa..45346091af8 100644 --- a/package.json +++ b/package.json @@ -156,7 +156,7 @@ "@angular/platform-browser": "18.2.13", "@angular/platform-browser-dynamic": "18.2.13", "@angular/router": "18.2.13", - "@bitwarden/sdk-internal": "0.2.0-main.163", + "@bitwarden/sdk-internal": "0.2.0-main.168", "@electron/fuses": "1.8.0", "@emotion/css": "11.13.5", "@koa/multer": "3.0.2",