JDK-7003784 : SecureRandom.nextBytes() throws ExceptionInInitializerError with -Djava.security.egd=file:filename
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 6u22-rev
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-12-01
  • Updated: 2014-07-17
  • Resolved: 2011-03-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u21Fixed
Related Reports
Relates :  
Relates :  
Description
The Security 6 test case
Performance/SeedGenerator
failed during testing of the Nightly build 6u22-rev-b00-2010-11-27 with the following Exception messages:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at sun.security.provider.SecureRandom.engineNextBytes(SecureRandom.java:170)
        at java.security.SecureRandom.nextBytes(SecureRandom.java:433)
        at SeedGenerator.run(SeedGenerator.java:15)
        at SeedGenerator.main(SeedGenerator.java:28)
Caused by: java.lang.IllegalArgumentException: URI is not hierarchical
        at java.io.File.<init>(File.java:363)
        at sun.security.provider.SeedGenerator$URLSeedGenerator$1.run(SeedGenerator.java:438)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.security.provider.SeedGenerator$URLSeedGenerator.init(SeedGenerator.java:433)
        at sun.security.provider.SeedGenerator$URLSeedGenerator.<init>(SeedGenerator.java:423)
        at sun.security.provider.SeedGenerator.<clinit>(SeedGenerator.java:92)

Comments
EVALUATION Fix for 6998583 introduced a more complex exception handling stack for URLSeedGenerator.init(). A java.lang.IllegalArgumentException exception stemming from the new device.toURI() call is not being caught correctly and as a result means an invalid URL (-Djava.security.egd) will not result in the ThreadSeedGenerator class being used instead. Fix is to provide a catch all exception so that we can throw back an IOException to the URLSeedGenerator constructor resulting in the ThreadSeedGenerator class being used instead.
01-12-2010