You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2022/08/21 14:21:40 UTC

[hbase] branch master updated: HBASE-27089 Add “commons.crypto.stream.buffer.size” configuration (#4491)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 7ff927dbd84 HBASE-27089 Add “commons.crypto.stream.buffer.size” configuration (#4491)
7ff927dbd84 is described below

commit 7ff927dbd84578f203e83c6695165443059b3f23
Author: wenwj0 <36...@users.noreply.github.com>
AuthorDate: Sun Aug 21 22:21:32 2022 +0800

    HBASE-27089 Add “commons.crypto.stream.buffer.size” configuration (#4491)
    
    Co-authored-by: wenwj0 <we...@huawei.com>
    Signed-off-by: Duo Zhang <zh...@apache.org>
---
 .../java/org/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;
   }