We have an issue when upgrading bcprov-jdk15on-160.jar
and bctls-jdk15on-160.jar
to bcprov-jdk15on-161.jar
and bctls-jdk15on-161.jar
or higher versions
java.lang.InternalError: unable to open random source at org.bouncycastle.jcajce.provider.drbg.DRBG$URLSeededSecureRandom$1.run(DRBG.java:294) at org.bouncycastle.jcajce.provider.drbg.DRBG$URLSeededSecureRandom$1.run(DRBG.java:285) at java.security.AccessController.doPrivileged(Native Method) at org.bouncycastle.jcajce.provider.drbg.DRBG$URLSeededSecureRandom.(DRBG.java:284) at org.bouncycastle.jcajce.provider.drbg.DRBG.createCoreSecureRandom(DRBG.java:131) at org.bouncycastle.jcajce.provider.drbg.DRBG.createInitialEntropySource(DRBG.java:115) at org.bouncycastle.jcajce.provider.drbg.DRBG.access$400(DRBG.java:29) at org.bouncycastle.jcajce.provider.drbg.DRBG$HybridSecureRandom.(DRBG.java:357) at org.bouncycastle.jcajce.provider.drbg.DRBG.createBaseRandom(DRBG.java:179) at org.bouncycastle.jcajce.provider.drbg.DRBG.access$100(DRBG.java:29) at org.bouncycastle.jcajce.provider.drbg.DRBG$Default.(DRBG.java:193) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:357) at java.lang.Class.newInstance(Class.java:310) at java.security.Provider$Service.newInstance(Provider.java:1221) at sun.security.jca.GetInstance.getInstance(GetInstance.java:220) at sun.security.jca.GetInstance.getInstance(GetInstance.java:147) at java.security.SecureRandom.getInstance(SecureRandom.java:254) at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:176) at java.security.SecureRandom.(SecureRandom.java:133)
when enabled debug log. It is an error about \dev\urandom
java.io.FileNotFoundException: \dev\urandom (The system cannot find the path specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:120) at java.io.FileInputStream.(FileInputStream.java:79) at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70) at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161) at java.net.URL.openStream(URL.java:1010) at org.bouncycastle.jcajce.provider.drbg.DRBG$URLSeededSecureRandom$1.run(DRBG.java:290) at org.bouncycastle.jcajce.provider.drbg.DRBG$URLSeededSecureRandom$1.run(DRBG.java:1) at java.security.AccessController.doPrivileged(Native Method) at org.bouncycastle.jcajce.provider.drbg.DRBG$URLSeededSecureRandom.(DRBG.java:284) at org.bouncycastle.jcajce.provider.drbg.DRBG.createCoreSecureRandom(DRBG.java:131) at org.bouncycastle.jcajce.provider.drbg.DRBG.createInitialEntropySource(DRBG.java:115) at org.bouncycastle.jcajce.provider.drbg.DRBG.access$2(DRBG.java:77) at org.bouncycastle.jcajce.provider.drbg.DRBG$HybridSecureRandom.(DRBG.java:358) at org.bouncycastle.jcajce.provider.drbg.DRBG.createBaseRandom(DRBG.java:179) at org.bouncycastle.jcajce.provider.drbg.DRBG.access$0(DRBG.java:162) at org.bouncycastle.jcajce.provider.drbg.DRBG$Default.(DRBG.java:193)
There is no issue when using the 160 version.
I am using Java 6 32 bit on Windows 10 64 bit.
Could someone help me with this?
Thanks.
public class BCUpgradeTest {
public static void main(String[] args) {
try {
Security.insertProviderAt(new BouncyCastleJsseProvider(), 1);
Security.insertProviderAt(new BouncyCastleProvider(), 1);
KeyAgreement ka = KeyAgreement.getInstance("ECDH");
System.out.println(ka.getProvider().getName());
} catch (Exception e) {
e.printStackTrace();
}
}
}