From 8cdf4e590518e2df29f6eec8233e6be08b284cdf Mon Sep 17 00:00:00 2001 From: zjt24 Date: Wed, 11 Dec 2024 15:54:50 +0800 Subject: [PATCH] use the same encrypt type in tsfile --- .../main/java/org/apache/tsfile/common/conf/TSFileConfig.java | 3 --- .../java/org/apache/tsfile/file/metadata/TsFileMetadata.java | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/java/tsfile/src/main/java/org/apache/tsfile/common/conf/TSFileConfig.java b/java/tsfile/src/main/java/org/apache/tsfile/common/conf/TSFileConfig.java index 4db621466..c09ac8d37 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/common/conf/TSFileConfig.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/common/conf/TSFileConfig.java @@ -268,9 +268,6 @@ public void setEncryptKey(String encryptKey) { } public void setEncryptKeyFromPath(String encryptKeyPath) { - if (!encryptFlag) { - return; - } this.encryptKey = EncryptUtils.getEncryptKeyFromPath(encryptKeyPath); EncryptUtils.encryptParam = EncryptUtils.getEncryptParameter(); EncryptUtils.normalKeyStr = EncryptUtils.getNormalKeyStr(); diff --git a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TsFileMetadata.java b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TsFileMetadata.java index e6c56688b..00db6b65a 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TsFileMetadata.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TsFileMetadata.java @@ -147,7 +147,7 @@ public static TsFileMetadata deserializeFrom(ByteBuffer buffer, DeserializeConfi } IDecryptor decryptor = IDecryptor.getDecryptor( - TSFileDescriptor.getInstance().getConfig().getEncryptType(), + propertiesMap.get("encryptType"), TSFileDescriptor.getInstance().getConfig().getEncryptKey().getBytes()); String str = propertiesMap.get("encryptKey"); fileMetaData.dataEncryptKey = decryptor.decrypt(EncryptUtils.getSecondKeyFromStr(str));