Skip to content

Commit

Permalink
use the same encrypt type in tsfile (#333)
Browse files Browse the repository at this point in the history
(cherry picked from commit 96a7432)
  • Loading branch information
zhujt20 authored and jt2594838 committed Dec 11, 2024
1 parent 7566d12 commit e96af65
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit e96af65

Please sign in to comment.