RFR: JDK-8293412 Remove unnecessary java.security.egd overrides

Daniel Jeliński djelinski at openjdk.org
Mon Oct 31 09:39:54 UTC 2022


On Fri, 14 Oct 2022 21:49:07 GMT, Mark Powers <mpowers at openjdk.org> wrote:

> https://bugs.openjdk.org/browse/JDK-8293412

I'm still verifying the jarsigner and the SecurityTools changes, but all of the other files actually need the EGD override.

test/jdk/java/security/SecureRandom/ApiTest.java line 56:

> 54: 
> 55:     public static void main(String[] args) throws Exception {
> 56:         System.setProperty("java.security.egd", "file:/dev/urandom");

This test uses generateSeed and needs egd.

test/jdk/java/security/SecureRandom/EnoughSeedTest.java line 43:

> 41: 
> 42:     public static void main(String[] args) {
> 43:         System.setProperty("java.security.egd", "file:/dev/urandom");

This test uses generateSeed and needs egd to avoid reading from /dev/random

test/jdk/java/security/SecureRandom/MacNativePRNGSetSeed.java line 30:

> 28:  * @summary Cannot call setSeed on NativePRNG on Mac if EGD is /dev/urandom
> 29:  * @requires os.name == "Mac OS X"
> 30:  * @run main/othervm -Djava.security.egd=file:/dev/urandom MacNativePRNGSetSeed

this change makes this test pointless, see summary 2 lines above

test/jdk/java/security/SecureRandom/MultiThreadTest.java line 44:

> 42:  * @summary Test behavior of a shared SecureRandom object when it is operated
> 43:  *          by multiple threads concurrently.
> 44:  * @run main/othervm -Djava.security.egd=file:/dev/urandom MultiThreadTest

This uses generateSeed and needs egd to avoid using dev/random

test/jdk/java/security/SecureRandom/Serialize.java line 36:

> 34: 
> 35:     public static void main(String args[]) throws Exception {
> 36:         System.setProperty("java.security.egd", "file:/dev/urandom");

This uses generateSeed and needs egd to avoid using dev/random

test/jdk/java/security/SecureRandom/SerializedSeedTest.java line 32:

> 30:  *          generated random numbers should be different when one or both are
> 31:  *          reseeded.
> 32:  * @run main/othervm -Djava.security.egd=file:/dev/urandom SerializedSeedTest

This uses generateSeed and needs egd to avoid using dev/random

test/jdk/sun/security/provider/SecureRandom/AutoReseed.java line 31:

> 29:  * @bug 8051408
> 30:  * @summary make sure nextBytes etc can be called before setSeed
> 31:  * @run main/othervm -Djava.security.egd=file:/dev/urandom AutoReseed

This test uses generateSeed and needs egd to avoid reading from /dev/random

test/jdk/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java line 29:

> 27:  * @summary NativeSeedGenerator is making 8192 byte read requests from
> 28:  *             entropy pool on each init.
> 29:  * @run main/othervm -Djava.security.egd=file:/dev/random SeedGeneratorChoice

This test uses generateSeed and should be run with egd pointing to /dev/urandom to avoid reading from /dev/random

-------------

Changes requested by djelinski (Committer).

PR: https://git.openjdk.org/jdk/pull/10716


More information about the security-dev mailing list