Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4919492

SeedGenerator/Fips.java fails on some Linux versions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • security-libs
    • tiger
    • generic, x86
    • generic, linux

      After the integration of 4705093 the regression test sun/security/provider/SeedGenerator/Fips.java fails on some Linux platforms/kernel versions (e.g. RHAS 2.1):

      Exception in thread "main" java.security.ProviderException: generateSeed() failed
              at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:208)
              at sun.security.provider.NativePRNG$RandomIO.access$300(NativePRNG.java:106)
              at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:100)
              at java.security.SecureRandom.generateSeed(SecureRandom.java:450)
              at java.security.SecureRandom.getSeed(SecureRandom.java:437)
              at Fips.generate(Fips.java:32)
              at Fips.main(Fips.java:218)
      Caused by: java.io.IOException: Could not read from /dev/u[random]
              at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:196)
              at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:205)
              ... 6 more

      The reason is that reads from /dev/random do not block until all requested bytes are available as expected.

      Note that this affects applications explicitly calling generateSeed() to obtain large amounts of seed material only.

      ===
      Also causes JCK test api/java_security/SecureRandom/SecureRandomTests.html#misc to fail.

      ###@###.### 2003-09-11

            andreas Andreas Sterbenz
            andreas Andreas Sterbenz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: