Skip to content

Commit 96100ad

Browse files
committed
8293412: Remove unnecessary java.security.egd overrides
Reviewed-by: mdoerr Backport-of: 79d163d4994d235266117b425498b0df3d16c3c4
1 parent 34fd121 commit 96100ad

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

test/jdk/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
2626
* @bug 6998583 8141039
2727
* @summary NativeSeedGenerator is making 8192 byte read requests from
2828
* entropy pool on each init.
29-
* @run main/othervm -Djava.security.egd=file:/dev/random SeedGeneratorChoice
29+
* @run main/othervm -Djava.security.egd=file:/dev/urandom SeedGeneratorChoice
3030
* @run main/othervm -Djava.security.egd=file:filename SeedGeneratorChoice
3131
*/
3232

test/jdk/sun/security/tools/jarsigner/compatibility/Compatibility.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -1036,15 +1036,9 @@ private static OutputAnalyzer execTool(String toolPath, String... args)
10361036
long start = System.currentTimeMillis();
10371037
try {
10381038
String[] cmd;
1039-
if (Platform.isWindows()) {
1040-
cmd = new String[args.length + 3];
1041-
System.arraycopy(args, 0, cmd, 3, args.length);
1042-
} else {
1043-
cmd = new String[args.length + 4];
1044-
cmd[3] = "-J-Djava.security.egd=file:/dev/./urandom";
1045-
System.arraycopy(args, 0, cmd, 4, args.length);
1046-
}
10471039

1040+
cmd = new String[args.length + 3];
1041+
System.arraycopy(args, 0, cmd, 3, args.length);
10481042
cmd[0] = toolPath;
10491043
cmd[1] = "-J-Duser.language=en";
10501044
cmd[2] = "-J-Duser.country=US";

test/lib/jdk/test/lib/SecurityTools.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
/**
4141
* Run security tools (including jarsigner and keytool) in a new process.
4242
* The en_US locale is always used so a test can always match output to
43-
* English text. {@code /dev/urandom} is used as entropy source so tool will
44-
* not block because of entropy scarcity. An argument can be a normal string,
43+
* English text. An argument can be a normal string,
4544
* {@code -Jvm-options}, {@code $sysProp} or {@code -J$sysProp}.
4645
*/
4746
public class SecurityTools {
@@ -58,9 +57,6 @@ public static ProcessBuilder getProcessBuilder(String tool, List<String> args) {
5857
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK(tool)
5958
.addVMArg("-Duser.language=en")
6059
.addVMArg("-Duser.country=US");
61-
if (!Platform.isWindows()) {
62-
launcher.addVMArg("-Djava.security.egd=file:/dev/./urandom");
63-
}
6460
for (String arg : args) {
6561
if (arg.startsWith("-J")) {
6662
String jarg = arg.substring(2);

0 commit comments

Comments
 (0)