RFR: 8293326: jdk/sun/security/tools/jarsigner/compatibility/SignTwice.java slow on Windows
Daniel Jeliński
djelinski at openjdk.org
Mon Sep 5 17:07:51 UTC 2022
On Mon, 5 Sep 2022 09:29:49 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
> This patch enables SignTwice test to complete faster on Windows machines.
>
> The test starts `keytool` and `jarsigner` a number of times, passing `-J-Djava.security.egd=file:/dev/./urandom` to the started process, presumably to avoid blocking on VMs with insufficient entropy. This works fine on machines where `/dev/./urandom` is actually present. On Windows it makes the JVM use `ThreadedSeedGenerator`, which is very slow compared to the other options.
>
> The fix removes `java.security.egd` setting on Windows machines.
>
> Alternatively we could change the egd to use `file:/dev/urandom` (without the `/./` part); this also fixes the Windows problem. Is the `/./` part still needed? If I understand correctly, it was a workaround for some JDK7 bug.
as far as I can tell, the `dev/./urandom` trick was only needed before 63a6638ebfe5b492d3156694024b37fa7a229a86, which was shipped in JDK8.
`jdk.test.lib.SecurityTools` is also using `dev/./urandom`, so I'll leave the dot here for now.
-------------
PR: https://git.openjdk.org/jdk/pull/10160
More information about the security-dev
mailing list