Blame SOURCES/rh1906862-always_initialise_configurator_access.patch

cdbd41
# HG changeset patch
cdbd41
# User andrew
cdbd41
# Date 1608219816 0
cdbd41
#      Thu Dec 17 15:43:36 2020 +0000
cdbd41
# Node ID db5d1b28bfce04352b3a48960bf836f6eb20804b
cdbd41
# Parent  a2cfa397150e99b813354226d536eb8509b5850b
cdbd41
RH1906862: Always initialise JavaSecuritySystemConfiguratorAccess
cdbd41
cdbd41
diff --git openjdk.orig/jdk/src/share/classes/java/security/Security.java openjdk/jdk/src/share/classes/java/security/Security.java
cdbd41
--- openjdk.orig/jdk/src/share/classes/java/security/Security.java
cdbd41
+++ openjdk/jdk/src/share/classes/java/security/Security.java
cdbd41
@@ -30,6 +30,8 @@
cdbd41
 import java.util.concurrent.ConcurrentHashMap;
cdbd41
 import java.io.*;
cdbd41
 import java.net.URL;
cdbd41
+import sun.misc.SharedSecrets;
cdbd41
+import sun.misc.JavaSecuritySystemConfiguratorAccess;
cdbd41
 import sun.security.util.Debug;
cdbd41
 import sun.security.util.PropertyExpander;
cdbd41
 
cdbd41
@@ -69,6 +71,15 @@
cdbd41
     }
cdbd41
 
cdbd41
     static {
cdbd41
+        // Initialise here as used by code with system properties disabled
cdbd41
+        SharedSecrets.setJavaSecuritySystemConfiguratorAccess(
cdbd41
+            new JavaSecuritySystemConfiguratorAccess() {
cdbd41
+                @Override
cdbd41
+                public boolean isSystemFipsEnabled() {
cdbd41
+                    return SystemConfigurator.isSystemFipsEnabled();
cdbd41
+                }
cdbd41
+            });
cdbd41
+
cdbd41
         // doPrivileged here because there are multiple
cdbd41
         // things in initialize that might require privs.
cdbd41
         // (the FileInputStream call and the File.exists call,
cdbd41
diff --git openjdk.orig/jdk/src/share/classes/java/security/SystemConfigurator.java openjdk/jdk/src/share/classes/java/security/SystemConfigurator.java
cdbd41
--- openjdk.orig/jdk/src/share/classes/java/security/SystemConfigurator.java
cdbd41
+++ openjdk/jdk/src/share/classes/java/security/SystemConfigurator.java
cdbd41
@@ -39,8 +39,6 @@
cdbd41
 import java.util.Properties;
cdbd41
 import java.util.regex.Pattern;
cdbd41
 
cdbd41
-import sun.misc.SharedSecrets;
cdbd41
-import sun.misc.JavaSecuritySystemConfiguratorAccess;
cdbd41
 import sun.security.util.Debug;
cdbd41
 
cdbd41
 /**
cdbd41
@@ -66,16 +64,6 @@
cdbd41
 
cdbd41
     private static boolean systemFipsEnabled = false;
cdbd41
 
cdbd41
-    static {
cdbd41
-        SharedSecrets.setJavaSecuritySystemConfiguratorAccess(
cdbd41
-            new JavaSecuritySystemConfiguratorAccess() {
cdbd41
-                @Override
cdbd41
-                public boolean isSystemFipsEnabled() {
cdbd41
-                    return SystemConfigurator.isSystemFipsEnabled();
cdbd41
-                }
cdbd41
-            });
cdbd41
-    }
cdbd41
-
cdbd41
     /*
cdbd41
      * Invoked when java.security.Security class is initialized, if
cdbd41
      * java.security.disableSystemPropertiesFile property is not set and