Blame SOURCES/rh2021263-fips_ensure_security_initialised.patch

95617d
commit 8a8452b9ae862755210a9a2f4e34b1aa3ec7343d
95617d
Author: Andrew Hughes <gnu.andrew@redhat.com>
95617d
Date:   Tue Jan 18 02:00:55 2022 +0000
95617d
95617d
    RH2021263: Make sure java.security.Security is initialised when retrieving JavaSecuritySystemConfiguratorAccess instance
95617d
95617d
diff --git openjdk.orig/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java openjdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
95617d
index 2ec51d57806..8489b940c43 100644
95617d
--- openjdk.orig/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
95617d
+++ openjdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
95617d
@@ -36,6 +36,7 @@ import java.io.FilePermission;
95617d
 import java.io.ObjectInputStream;
95617d
 import java.io.RandomAccessFile;
95617d
 import java.security.ProtectionDomain;
95617d
+import java.security.Security;
95617d
 import java.security.Signature;
95617d
 
95617d
 /** A repository of "shared secrets", which are a mechanism for
95617d
@@ -368,6 +369,9 @@ public class SharedSecrets {
95617d
     }
95617d
 
95617d
     public static JavaSecuritySystemConfiguratorAccess getJavaSecuritySystemConfiguratorAccess() {
95617d
+        if (javaSecuritySystemConfiguratorAccess == null) {
95617d
+            unsafe.ensureClassInitialized(Security.class);
95617d
+        }
95617d
         return javaSecuritySystemConfiguratorAccess;
95617d
     }
95617d
 }