Blame SOURCES/rh2021263-fips_ensure_security_initialised.patch

dee830
commit 4ac1a03b3ec73358988553fe9e200130847ea3b4
dee830
Author: Andrew Hughes <gnu.andrew@redhat.com>
dee830
Date:   Mon Jan 10 20:19:40 2022 +0000
dee830
dee830
    RH2021263: Make sure java.security.Security is initialised when retrieving JavaSecuritySystemConfiguratorAccess instance
dee830
dee830
diff --git openjdk.orig/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java openjdk/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java
dee830
index 5a2c9eb0c46..a1ee182d913 100644
dee830
--- openjdk.orig/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java
dee830
+++ openjdk/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java
dee830
@@ -39,6 +39,7 @@ import java.io.FilePermission;
dee830
 import java.io.ObjectInputStream;
dee830
 import java.io.RandomAccessFile;
dee830
 import java.security.ProtectionDomain;
dee830
+import java.security.Security;
dee830
 import java.security.Signature;
dee830
 
dee830
 /** A repository of "shared secrets", which are a mechanism for
dee830
@@ -449,6 +450,9 @@ public class SharedSecrets {
dee830
     }
dee830
 
dee830
     public static JavaSecuritySystemConfiguratorAccess getJavaSecuritySystemConfiguratorAccess() {
dee830
+        if (javaSecuritySystemConfiguratorAccess == null) {
dee830
+            ensureClassInitialized(Security.class);
dee830
+        }
dee830
         return javaSecuritySystemConfiguratorAccess;
dee830
     }
dee830
 }