Blame SOURCES/rh1906862-always_initialise_configurator_access.patch

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