Skip to content

Commit bf6c20d

Browse files
committed
github bcgit#510 - eliminated warning happening with Java 12.
1 parent 7758c14 commit bf6c20d

File tree

1 file changed

+3
-5
lines changed
  • prov/src/main/java/org/bouncycastle/jcajce/provider/drbg

1 file changed

+3
-5
lines changed

prov/src/main/java/org/bouncycastle/jcajce/provider/drbg/DRBG.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ public class DRBG
4242
{"org.conscrypt.OpenSSLProvider", "org.conscrypt.OpenSSLRandom"},
4343
};
4444

45-
private static final Object[] initialEntropySourceAndSpi = findSource();
46-
4745
// Cascade through providers looking for match.
4846
private final static Object[] findSource()
4947
{
@@ -68,7 +66,7 @@ private final static Object[] findSource()
6866
private static class CoreSecureRandom
6967
extends SecureRandom
7068
{
71-
CoreSecureRandom()
69+
CoreSecureRandom(Object[] initialEntropySourceAndSpi)
7270
{
7371
super((SecureRandomSpi)initialEntropySourceAndSpi[1], (Provider)initialEntropySourceAndSpi[0]);
7472
}
@@ -120,9 +118,9 @@ public SecureRandom run()
120118

121119
private static SecureRandom createCoreSecureRandom()
122120
{
123-
if (initialEntropySourceAndSpi != null)
121+
if (Security.getProperty("securerandom.source") == null)
124122
{
125-
return new CoreSecureRandom();
123+
return new CoreSecureRandom(findSource());
126124
}
127125
else
128126
{

0 commit comments

Comments
 (0)