HADOOP-16011. OsSecureRandom very slow compared to other SecureRandom implementations. Contributed by Siyao Meng.
Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
This commit is contained in:
parent
366186d999
commit
e62cbcbc83
@ -30,7 +30,7 @@
|
|||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
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.apache.hadoop.util.ReflectionUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -57,7 +57,7 @@ public OpensslAesCtrCryptoCodec() {
|
|||||||
public void setConf(Configuration conf) {
|
public void setConf(Configuration conf) {
|
||||||
this.conf = conf;
|
this.conf = conf;
|
||||||
final Class<? extends Random> klass = conf.getClass(
|
final Class<? extends Random> klass = conf.getClass(
|
||||||
HADOOP_SECURITY_SECURE_RANDOM_IMPL_KEY, OsSecureRandom.class,
|
HADOOP_SECURITY_SECURE_RANDOM_IMPL_KEY, OpensslSecureRandom.class,
|
||||||
Random.class);
|
Random.class);
|
||||||
try {
|
try {
|
||||||
random = ReflectionUtils.newInstance(klass, conf);
|
random = ReflectionUtils.newInstance(klass, conf);
|
||||||
|
@ -2889,7 +2889,7 @@
|
|||||||
|
|
||||||
<property>
|
<property>
|
||||||
<name>hadoop.security.secure.random.impl</name>
|
<name>hadoop.security.secure.random.impl</name>
|
||||||
<value></value>
|
<value>org.apache.hadoop.crypto.random.OpensslSecureRandom</value>
|
||||||
<description>
|
<description>
|
||||||
Implementation of secure random.
|
Implementation of secure random.
|
||||||
</description>
|
</description>
|
||||||
|
Loading…
Reference in New Issue
Block a user