Blame SOURCES/rh2021263-fips_ensure_security_initialised.patch

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