diff --git a/build.gradle b/build.gradle index 55cd151fbb..16ad954914 100644 --- a/build.gradle +++ b/build.gradle @@ -305,8 +305,7 @@ applicationDefaultJvmArgs = [ "-Dpantheon.home=PANTHEON_HOME", // We shutdown log4j ourselves, as otherwise his shutdown hook runs before our own and whatever // happens during shutdown is not logged. - "-Dlog4j.shutdownHookEnabled=false", - "-Djava.security.egd=file:/dev/urandom" + "-Dlog4j.shutdownHookEnabled=false" ] run { diff --git a/crypto/src/main/java/net/consensys/pantheon/crypto/SecureRandomProvider.java b/crypto/src/main/java/net/consensys/pantheon/crypto/SecureRandomProvider.java index 21037d7994..a84ee049ed 100644 --- a/crypto/src/main/java/net/consensys/pantheon/crypto/SecureRandomProvider.java +++ b/crypto/src/main/java/net/consensys/pantheon/crypto/SecureRandomProvider.java @@ -3,7 +3,7 @@ package net.consensys.pantheon.crypto; import java.security.SecureRandom; public class SecureRandomProvider { - private static final SecureRandom publicSecureRandom = new PRNGSecureRandom(); + private static final SecureRandom publicSecureRandom = secureRandom(); // Returns a shared instance of secure random intended to be used where the value is used publicly public static SecureRandom publicSecureRandom() { @@ -11,6 +11,11 @@ public class SecureRandomProvider { } public static SecureRandom createSecureRandom() { - return new PRNGSecureRandom(); + return secureRandom(); + } + + @SuppressWarnings("DoNotCreateSecureRandomDirectly") + private static SecureRandom secureRandom() { + return new SecureRandom(); } }