From 79d163d4994d235266117b425498b0df3d16c3c4 Mon Sep 17 00:00:00 2001
From: Mark Powers <mpowers@openjdk.org>
Date: Tue, 6 Dec 2022 20:36:50 +0000
Subject: [PATCH] 8293412: Remove unnecessary java.security.egd overrides

Reviewed-by: xuelei, djelinski
---
 .../provider/SeedGenerator/SeedGeneratorChoice.java    |  4 ++--
 .../tools/jarsigner/compatibility/Compatibility.java   | 10 ++--------
 test/lib/jdk/test/lib/SecurityTools.java               |  6 +-----
 3 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/test/jdk/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java b/test/jdk/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java
index 581dc54216b..01c3dfd06a1 100644
--- a/test/jdk/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java
+++ b/test/jdk/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
  * @bug 6998583 8141039
  * @summary NativeSeedGenerator is making 8192 byte read requests from
  *             entropy pool on each init.
- * @run main/othervm -Djava.security.egd=file:/dev/random SeedGeneratorChoice
+ * @run main/othervm -Djava.security.egd=file:/dev/urandom SeedGeneratorChoice
  * @run main/othervm -Djava.security.egd=file:filename  SeedGeneratorChoice
  */
 
diff --git a/test/jdk/sun/security/tools/jarsigner/compatibility/Compatibility.java b/test/jdk/sun/security/tools/jarsigner/compatibility/Compatibility.java
index 87fa6483009..b0e65f17441 100644
--- a/test/jdk/sun/security/tools/jarsigner/compatibility/Compatibility.java
+++ b/test/jdk/sun/security/tools/jarsigner/compatibility/Compatibility.java
@@ -1036,15 +1036,9 @@ public class Compatibility {
         long start = System.currentTimeMillis();
         try {
             String[] cmd;
-            if (Platform.isWindows()) {
-                cmd = new String[args.length + 3];
-                System.arraycopy(args, 0, cmd, 3, args.length);
-            } else {
-                cmd = new String[args.length + 4];
-                cmd[3] = "-J-Djava.security.egd=file:/dev/./urandom";
-                System.arraycopy(args, 0, cmd, 4, args.length);
-            }
 
+            cmd = new String[args.length + 3];
+            System.arraycopy(args, 0, cmd, 3, args.length);
             cmd[0] = toolPath;
             cmd[1] = "-J-Duser.language=en";
             cmd[2] = "-J-Duser.country=US";
diff --git a/test/lib/jdk/test/lib/SecurityTools.java b/test/lib/jdk/test/lib/SecurityTools.java
index 6e3a55f7e5c..ff13343ad32 100644
--- a/test/lib/jdk/test/lib/SecurityTools.java
+++ b/test/lib/jdk/test/lib/SecurityTools.java
@@ -40,8 +40,7 @@ import jdk.test.lib.process.ProcessTools;
 /**
  * Run security tools (including jarsigner and keytool) in a new process.
  * The en_US locale is always used so a test can always match output to
- * English text. {@code /dev/urandom} is used as entropy source so tool will
- * not block because of entropy scarcity. An argument can be a normal string,
+ * English text. An argument can be a normal string,
  * {@code -Jvm-options}, or {@code $sysProp}.
  */
 public class SecurityTools {
@@ -58,9 +57,6 @@ public class SecurityTools {
         JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK(tool)
                 .addVMArg("-Duser.language=en")
                 .addVMArg("-Duser.country=US");
-        if (!Platform.isWindows()) {
-            launcher.addVMArg("-Djava.security.egd=file:/dev/./urandom");
-        }
         for (String arg : args) {
             if (arg.startsWith("-J")) {
                 launcher.addVMArg(arg.substring(2));