Blame SOURCES/rh2021263-fips_ensure_security_initialised.patch

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