Blame SOURCES/rh2021263-fips_ensure_security_initialised.patch

2ea0ba
commit 06c2decab204fcce5aca2d285953fcac1820b1ae
2ea0ba
Author: Andrew John Hughes <andrew@openjdk.org>
2ea0ba
Date:   Mon Jan 24 01:23:28 2022 +0000
2ea0ba
2ea0ba
    RH2021263: Make sure java.security.Security is initialised when retrieving JavaSecuritySystemConfiguratorAccess instance
2ea0ba
2ea0ba
diff --git openjdk.orig/jdk/src/share/classes/sun/misc/SharedSecrets.java openjdk/jdk/src/share/classes/sun/misc/SharedSecrets.java
2ea0ba
index 40ca609e02..0dafe6f59c 100644
2ea0ba
--- openjdk.orig/jdk/src/share/classes/sun/misc/SharedSecrets.java
2ea0ba
+++ openjdk/jdk/src/share/classes/sun/misc/SharedSecrets.java
2ea0ba
@@ -31,6 +31,7 @@ import java.io.Console;
2ea0ba
 import java.io.FileDescriptor;
2ea0ba
 import java.io.ObjectInputStream;
2ea0ba
 import java.security.ProtectionDomain;
2ea0ba
+import java.security.Security;
2ea0ba
 import java.security.Signature;
2ea0ba
 
2ea0ba
 import java.security.AccessController;
2ea0ba
@@ -255,6 +256,9 @@ public class SharedSecrets {
2ea0ba
     }
2ea0ba
 
2ea0ba
     public static JavaSecuritySystemConfiguratorAccess getJavaSecuritySystemConfiguratorAccess() {
2ea0ba
+        if (javaSecuritySystemConfiguratorAccess == null) {
2ea0ba
+            unsafe.ensureClassInitialized(Security.class);
2ea0ba
+        }
2ea0ba
         return javaSecuritySystemConfiguratorAccess;
2ea0ba
     }
2ea0ba
 }