From 7a037724d5cef326d95f8c93f51a37c39b088d3b Mon Sep 17 00:00:00 2001 From: Jacob Fink Date: Tue, 30 May 2023 12:59:06 -0400 Subject: [PATCH] update cipher service to use new crypto service --- libs/common/src/vault/services/cipher.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/common/src/vault/services/cipher.service.ts b/libs/common/src/vault/services/cipher.service.ts index 122eea4ee66..7258d3a995e 100644 --- a/libs/common/src/vault/services/cipher.service.ts +++ b/libs/common/src/vault/services/cipher.service.ts @@ -325,9 +325,9 @@ export class CipherService implements CipherServiceAbstraction { return await this.getDecryptedCipherCache(); } - const hasKey = await this.cryptoService.hasKey(); + const hasKey = await this.cryptoService.hasUserKey(); if (!hasKey) { - throw new Error("No key."); + throw new Error("No user key found."); } const ciphers = await this.getAll(); @@ -636,7 +636,7 @@ export class CipherService implements CipherServiceAbstraction { const key = await this.cryptoService.getOrgKey(cipher.organizationId); const encFileName = await this.cryptoService.encrypt(filename, key); - const dataEncKey = await this.cryptoService.makeEncKey(key); + const dataEncKey = await this.cryptoService.makeUserSymKey(key); const encData = await this.cryptoService.encryptToBytes(data, dataEncKey[0]); const response = await this.cipherFileUploadService.upload( @@ -949,7 +949,7 @@ export class CipherService implements CipherServiceAbstraction { const key = await this.cryptoService.getOrgKey(organizationId); const encFileName = await this.cryptoService.encrypt(attachmentView.fileName, key); - const dataEncKey = await this.cryptoService.makeEncKey(key); + const dataEncKey = await this.cryptoService.makeUserSymKey(key); const encData = await this.cryptoService.encryptToBytes(decBuf, dataEncKey[0]); const fd = new FormData();