From 65897dadb7d0d56a63b19cda6fea68f775cae3f6 Mon Sep 17 00:00:00 2001 From: Dawid Heyman Date: Tue, 19 Nov 2024 14:59:22 +0100 Subject: [PATCH] Change decodedKey -> decodedKek --- lib/file_transfer_agent/encrypt_util.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/file_transfer_agent/encrypt_util.js b/lib/file_transfer_agent/encrypt_util.js index c26544221..62bb12029 100644 --- a/lib/file_transfer_agent/encrypt_util.js +++ b/lib/file_transfer_agent/encrypt_util.js @@ -149,8 +149,8 @@ function EncryptUtil(encrypt, filestream, temp) { }; this.encryptDataCBC = function (encryptionMaterial, data) { - const decodedKey = Buffer.from(encryptionMaterial[QUERY_STAGE_MASTER_KEY], BASE64); - const keySize = decodedKey.length; + const decodedKek = Buffer.from(encryptionMaterial[QUERY_STAGE_MASTER_KEY], BASE64); + const keySize = decodedKek.length; const dataIv = getSecureRandom(AES_CBC.ivSize); const fileKey = getSecureRandom(keySize); @@ -158,7 +158,7 @@ function EncryptUtil(encrypt, filestream, temp) { const dataCipher = crypto.createCipheriv(AES_CBC.cipherName(keySize), fileKey, dataIv); const encryptedData = performCrypto(dataCipher, data); - const keyCipher = crypto.createCipheriv(AES_ECB.cipherName(keySize), decodedKey, null); + const keyCipher = crypto.createCipheriv(AES_ECB.cipherName(keySize), decodedKek, null); const encryptedKey = performCrypto(keyCipher, fileKey); return {