From e62cbcbc83026a7af43eac6223fe53f9de963d91 Mon Sep 17 00:00:00 2001 From: Siyao Meng Date: Wed, 3 Apr 2019 14:28:43 -0700 Subject: [PATCH] HADOOP-16011. OsSecureRandom very slow compared to other SecureRandom implementations. Contributed by Siyao Meng. Signed-off-by: Wei-Chiu Chuang --- .../org/apache/hadoop/crypto/OpensslAesCtrCryptoCodec.java | 4 ++-- .../hadoop-common/src/main/resources/core-default.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/OpensslAesCtrCryptoCodec.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/OpensslAesCtrCryptoCodec.java index 8d01f42095..a127925a7a 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/OpensslAesCtrCryptoCodec.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/OpensslAesCtrCryptoCodec.java @@ -30,7 +30,7 @@ import org.apache.hadoop.conf.Configuration; import com.google.common.base.Preconditions; -import org.apache.hadoop.crypto.random.OsSecureRandom; +import org.apache.hadoop.crypto.random.OpensslSecureRandom; import org.apache.hadoop.util.ReflectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -57,7 +57,7 @@ public OpensslAesCtrCryptoCodec() { public void setConf(Configuration conf) { this.conf = conf; final Class klass = conf.getClass( - HADOOP_SECURITY_SECURE_RANDOM_IMPL_KEY, OsSecureRandom.class, + HADOOP_SECURITY_SECURE_RANDOM_IMPL_KEY, OpensslSecureRandom.class, Random.class); try { random = ReflectionUtils.newInstance(klass, conf); diff --git a/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml b/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml index 5cb37f0e88..e77d35d2b2 100644 --- a/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml +++ b/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml @@ -2889,7 +2889,7 @@ hadoop.security.secure.random.impl - + org.apache.hadoop.crypto.random.OpensslSecureRandom Implementation of secure random.