Skip to content

Commit 118ce2e

Browse files
committed
RH1915071: Always initialise configurator access.patch
1 parent e8b5bf9 commit 118ce2e

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

src/java.base/share/classes/java/security/Security.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
import jdk.internal.event.EventHelper;
3434
import jdk.internal.event.SecurityPropertyModificationEvent;
35+
import jdk.internal.misc.JavaSecuritySystemConfiguratorAccess;
3536
import jdk.internal.misc.SharedSecrets;
3637
import jdk.internal.util.StaticProperty;
3738
import sun.security.util.Debug;
@@ -74,6 +75,15 @@ private static class ProviderProperty {
7475
}
7576

7677
static {
78+
// Initialise here as used by code with system properties disabled
79+
SharedSecrets.setJavaSecuritySystemConfiguratorAccess(
80+
new JavaSecuritySystemConfiguratorAccess() {
81+
@Override
82+
public boolean isSystemFipsEnabled() {
83+
return SystemConfigurator.isSystemFipsEnabled();
84+
}
85+
});
86+
7787
// doPrivileged here because there are multiple
7888
// things in initialize that might require privs.
7989
// (the FileInputStream call and the File.exists call,
@@ -193,9 +203,8 @@ private static void initialize() {
193203
}
194204

195205
String disableSystemProps = System.getProperty("java.security.disableSystemPropertiesFile");
196-
if (disableSystemProps == null &&
197-
"true".equalsIgnoreCase(props.getProperty
198-
("security.useSystemPropertiesFile"))) {
206+
if ((disableSystemProps == null || "false".equalsIgnoreCase(disableSystemProps)) &&
207+
"true".equalsIgnoreCase(props.getProperty("security.useSystemPropertiesFile"))) {
199208
if (SystemConfigurator.configure(props)) {
200209
loadedProps = true;
201210
}

src/java.base/share/classes/java/security/SystemConfigurator.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
import java.util.Properties;
3939
import java.util.regex.Pattern;
4040

41-
import jdk.internal.misc.SharedSecrets;
42-
import jdk.internal.misc.JavaSecuritySystemConfiguratorAccess;
4341
import sun.security.util.Debug;
4442

4543
/**
@@ -65,16 +63,6 @@ final class SystemConfigurator {
6563

6664
private static boolean systemFipsEnabled = false;
6765

68-
static {
69-
SharedSecrets.setJavaSecuritySystemConfiguratorAccess(
70-
new JavaSecuritySystemConfiguratorAccess() {
71-
@Override
72-
public boolean isSystemFipsEnabled() {
73-
return SystemConfigurator.isSystemFipsEnabled();
74-
}
75-
});
76-
}
77-
7866
/*
7967
* Invoked when java.security.Security class is initialized, if
8068
* java.security.disableSystemPropertiesFile property is not set and

0 commit comments

Comments
 (0)