Blame SOURCES/rh2021263-fips_ensure_security_initialised.patch

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