From 7ff927dbd84578f203e83c6695165443059b3f23 Mon Sep 17 00:00:00 2001 From: wenwj0 <36262341+wenwj0@users.noreply.github.com> Date: Sun, 21 Aug 2022 22:21:32 +0800 Subject: [PATCH] =?UTF-8?q?HBASE-27089=20Add=20=E2=80=9Ccommons.crypto.str?= =?UTF-8?q?eam.buffer.size=E2=80=9D=20configuration=20(#4491)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: wenwj0 Signed-off-by: Duo Zhang --- .../apache/hadoop/hbase/io/crypto/aes/CommonsCryptoAES.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/aes/CommonsCryptoAES.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/aes/CommonsCryptoAES.java index 55cd4a560f9..2d05e126f07 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/aes/CommonsCryptoAES.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/aes/CommonsCryptoAES.java @@ -26,6 +26,7 @@ import java.security.SecureRandom; import java.util.Properties; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.crypto.cipher.CryptoCipherFactory; +import org.apache.commons.crypto.stream.CryptoInputStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.io.crypto.Cipher; import org.apache.hadoop.hbase.io.crypto.CipherProvider; @@ -48,6 +49,8 @@ public class CommonsCryptoAES extends Cipher { public static final String CIPHER_MODE_KEY = "hbase.crypto.commons.mode"; public static final String CIPHER_CLASSES_KEY = "hbase.crypto.commons.cipher.classes"; public static final String CIPHER_JCE_PROVIDER_KEY = "hbase.crypto.commons.cipher.jce.provider"; + public static final String CRYPTOSTREAM_BUFFERSIZE_KEY = + "hbase.crypto.commons.cryptoStream.bufferSize"; private final String cipherMode; private Properties props; @@ -81,6 +84,8 @@ public class CommonsCryptoAES extends Cipher { props.setProperty(CryptoCipherFactory.CLASSES_KEY, conf.get(CIPHER_CLASSES_KEY, "")); props.setProperty(CryptoCipherFactory.JCE_PROVIDER_KEY, conf.get(CIPHER_JCE_PROVIDER_KEY, "")); + props.setProperty(CryptoInputStream.STREAM_BUFFER_SIZE_KEY, + conf.get(CRYPTOSTREAM_BUFFERSIZE_KEY, "")); return props; }