Blame SOURCES/rh2021263-fips_ensure_security_initialised.patch

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