|
|
f8e459 |
diff --git openjdk/src/java.base/share/classes/java/security/Security.java openjdk/src/java.base/share/classes/java/security/Security.java
|
|
|
f8e459 |
index f1633afb627..ce32c939253 100644
|
|
|
f8e459 |
--- openjdk/src/java.base/share/classes/java/security/Security.java
|
|
|
f8e459 |
+++ openjdk/src/java.base/share/classes/java/security/Security.java
|
|
|
f8e459 |
@@ -32,6 +32,7 @@ import java.net.URL;
|
|
|
f8e459 |
|
|
|
f8e459 |
import jdk.internal.event.EventHelper;
|
|
|
f8e459 |
import jdk.internal.event.SecurityPropertyModificationEvent;
|
|
|
f8e459 |
+import jdk.internal.access.JavaSecuritySystemConfiguratorAccess;
|
|
|
f8e459 |
import jdk.internal.access.SharedSecrets;
|
|
|
f8e459 |
import jdk.internal.util.StaticProperty;
|
|
|
f8e459 |
import sun.security.util.Debug;
|
|
|
f8e459 |
@@ -74,6 +75,15 @@ public final class Security {
|
|
|
f8e459 |
}
|
|
|
f8e459 |
|
|
|
f8e459 |
static {
|
|
|
f8e459 |
+ // Initialise here as used by code with system properties disabled
|
|
|
f8e459 |
+ SharedSecrets.setJavaSecuritySystemConfiguratorAccess(
|
|
|
f8e459 |
+ new JavaSecuritySystemConfiguratorAccess() {
|
|
|
f8e459 |
+ @Override
|
|
|
f8e459 |
+ public boolean isSystemFipsEnabled() {
|
|
|
f8e459 |
+ return SystemConfigurator.isSystemFipsEnabled();
|
|
|
f8e459 |
+ }
|
|
|
f8e459 |
+ });
|
|
|
f8e459 |
+
|
|
|
f8e459 |
// doPrivileged here because there are multiple
|
|
|
f8e459 |
// things in initialize that might require privs.
|
|
|
f8e459 |
// (the FileInputStream call and the File.exists call,
|
|
|
f8e459 |
@@ -194,9 +204,8 @@ public final class Security {
|
|
|
f8e459 |
}
|
|
|
f8e459 |
|
|
|
f8e459 |
String disableSystemProps = System.getProperty("java.security.disableSystemPropertiesFile");
|
|
|
f8e459 |
- if (disableSystemProps == null &&
|
|
|
f8e459 |
- "true".equalsIgnoreCase(props.getProperty
|
|
|
f8e459 |
- ("security.useSystemPropertiesFile"))) {
|
|
|
f8e459 |
+ if ((disableSystemProps == null || "false".equalsIgnoreCase(disableSystemProps)) &&
|
|
|
f8e459 |
+ "true".equalsIgnoreCase(props.getProperty("security.useSystemPropertiesFile"))) {
|
|
|
f8e459 |
if (SystemConfigurator.configure(props)) {
|
|
|
f8e459 |
loadedProps = true;
|
|
|
f8e459 |
}
|
|
|
f8e459 |
diff --git openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java
|
|
|
f8e459 |
index 60fa75cab45..10b54aa4ce4 100644
|
|
|
f8e459 |
--- openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java
|
|
|
f8e459 |
+++ openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java
|
|
|
f8e459 |
@@ -38,8 +38,6 @@ import java.util.Map.Entry;
|
|
|
f8e459 |
import java.util.Properties;
|
|
|
f8e459 |
import java.util.regex.Pattern;
|
|
|
f8e459 |
|
|
|
f8e459 |
-import jdk.internal.access.JavaSecuritySystemConfiguratorAccess;
|
|
|
f8e459 |
-import jdk.internal.access.SharedSecrets;
|
|
|
f8e459 |
import sun.security.util.Debug;
|
|
|
f8e459 |
|
|
|
f8e459 |
/**
|
|
|
f8e459 |
@@ -65,16 +63,6 @@ final class SystemConfigurator {
|
|
|
f8e459 |
|
|
|
f8e459 |
private static boolean systemFipsEnabled = false;
|
|
|
f8e459 |
|
|
|
f8e459 |
- static {
|
|
|
f8e459 |
- SharedSecrets.setJavaSecuritySystemConfiguratorAccess(
|
|
|
f8e459 |
- new JavaSecuritySystemConfiguratorAccess() {
|
|
|
f8e459 |
- @Override
|
|
|
f8e459 |
- public boolean isSystemFipsEnabled() {
|
|
|
f8e459 |
- return SystemConfigurator.isSystemFipsEnabled();
|
|
|
f8e459 |
- }
|
|
|
f8e459 |
- });
|
|
|
f8e459 |
- }
|
|
|
f8e459 |
-
|
|
|
f8e459 |
/*
|
|
|
f8e459 |
* Invoked when java.security.Security class is initialized, if
|
|
|
f8e459 |
* java.security.disableSystemPropertiesFile property is not set and
|