8293412: Remove unnecessary java.security.egd overrides

Reviewed-by: xuelei, djelinski
This commit is contained in:
Mark Powers 2022-12-06 20:36:50 +00:00 committed by Weijun Wang
parent ea83cb960d
commit 79d163d499
3 changed files with 5 additions and 15 deletions

View File

@ -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
*/

View File

@ -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";

View File

@ -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));