Skip to content

Commit

Permalink
8293412: Remove unnecessary java.security.egd overrides
Browse files Browse the repository at this point in the history
Reviewed-by: mdoerr
Backport-of: 79d163d
  • Loading branch information
GoeLin committed Jan 8, 2025
1 parent 34fd121 commit 96100ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1036,15 +1036,9 @@ private static OutputAnalyzer execTool(String toolPath, String... args)
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";
Expand Down
6 changes: 1 addition & 5 deletions test/lib/jdk/test/lib/SecurityTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
/**
* 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}, {@code $sysProp} or {@code -J$sysProp}.
*/
public class SecurityTools {
Expand All @@ -58,9 +57,6 @@ public static ProcessBuilder getProcessBuilder(String tool, List<String> args) {
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")) {
String jarg = arg.substring(2);
Expand Down

0 comments on commit 96100ad

Please sign in to comment.