From f075ff23a919fb004d3a98be39790e8498a5a263 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Sat, 8 Jun 2024 18:38:25 -0400 Subject: [PATCH] patch encoding type for kms --- backend/src/services/kms/kms-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/services/kms/kms-service.ts b/backend/src/services/kms/kms-service.ts index 24d901867..97d2b29d6 100644 --- a/backend/src/services/kms/kms-service.ts +++ b/backend/src/services/kms/kms-service.ts @@ -77,7 +77,7 @@ export const kmsServiceFactory = ({ kmsDAL, kmsRootConfigDAL, keyStore }: TKmsSe // This will switch to a seal process and HMS flow in future const encryptionKey = appCfg.ENCRYPTION_KEY || appCfg.ROOT_ENCRYPTION_KEY; // if root key its base64 encoded - const isBase64 = Boolean(appCfg.ROOT_ENCRYPTION_KEY); + const isBase64 = !appCfg.ENCRYPTION_KEY; if (!encryptionKey) throw new Error("Root encryption key not found for KMS service."); const encryptionKeyBuffer = Buffer.from(encryptionKey, isBase64 ? "base64" : "utf8");