Blame SOURCES/rh1995150-disable_non-fips_crypto.patch

59f4c0
diff --git openjdk.orig/src/java.base/share/classes/module-info.java openjdk/src/java.base/share/classes/module-info.java
59f4c0
index 63bb580eb3a..238735c0c8c 100644
59f4c0
--- openjdk.orig/src/java.base/share/classes/module-info.java
f8e459
+++ openjdk/src/java.base/share/classes/module-info.java
59f4c0
@@ -152,6 +152,7 @@ module java.base {
f8e459
         java.naming,
f8e459
         java.rmi,
59f4c0
         jdk.charsets,
f8e459
+        jdk.crypto.ec,
f8e459
         jdk.jartool,
f8e459
         jdk.jlink,
f8e459
         jdk.net,
59f4c0
diff --git openjdk.orig/src/java.base/share/classes/sun/security/provider/SunEntries.java openjdk/src/java.base/share/classes/sun/security/provider/SunEntries.java
59f4c0
index 912cad59714..7cb5ebcde51 100644
59f4c0
--- openjdk.orig/src/java.base/share/classes/sun/security/provider/SunEntries.java
f8e459
+++ openjdk/src/java.base/share/classes/sun/security/provider/SunEntries.java
f8e459
@@ -30,6 +30,7 @@ import java.net.*;
f8e459
 import java.util.*;
f8e459
 import java.security.*;
f8e459
 
f8e459
+import jdk.internal.access.SharedSecrets;
f8e459
 import jdk.internal.util.StaticProperty;
f8e459
 import sun.security.action.GetPropertyAction;
f8e459
 import sun.security.util.SecurityProviderConstants;
f8e459
@@ -83,6 +84,10 @@ import static sun.security.util.SecurityProviderConstants.getAliases;
f8e459
 
f8e459
 public final class SunEntries {
f8e459
 
f8e459
+    private static final boolean systemFipsEnabled =
f8e459
+            SharedSecrets.getJavaSecuritySystemConfiguratorAccess()
f8e459
+            .isSystemFipsEnabled();
f8e459
+
f8e459
     // the default algo used by SecureRandom class for new SecureRandom() calls
f8e459
     public static final String DEF_SECURE_RANDOM_ALGO;
f8e459
 
f8e459
@@ -94,147 +99,149 @@ public final class SunEntries {
f8e459
         // common attribute map
f8e459
         HashMap<String, String> attrs = new HashMap<>(3);
f8e459
 
f8e459
-        /*
f8e459
-         * SecureRandom engines
f8e459
-         */
f8e459
-        attrs.put("ThreadSafe", "true");
f8e459
-        if (NativePRNG.isAvailable()) {
f8e459
-            add(p, "SecureRandom", "NativePRNG",
f8e459
-                    "sun.security.provider.NativePRNG", attrs);
f8e459
-        }
f8e459
-        if (NativePRNG.Blocking.isAvailable()) {
f8e459
-            add(p, "SecureRandom", "NativePRNGBlocking",
f8e459
-                    "sun.security.provider.NativePRNG$Blocking", attrs);
f8e459
-        }
f8e459
-        if (NativePRNG.NonBlocking.isAvailable()) {
f8e459
-            add(p, "SecureRandom", "NativePRNGNonBlocking",
f8e459
-                    "sun.security.provider.NativePRNG$NonBlocking", attrs);
59f4c0
-        }
59f4c0
-        attrs.put("ImplementedIn", "Software");
59f4c0
-        add(p, "SecureRandom", "DRBG", "sun.security.provider.DRBG", attrs);
59f4c0
-        add(p, "SecureRandom", "SHA1PRNG",
59f4c0
-                "sun.security.provider.SecureRandom", attrs);
59f4c0
-
59f4c0
-        /*
59f4c0
-         * Signature engines
59f4c0
-         */
59f4c0
-        attrs.clear();
59f4c0
-        String dsaKeyClasses = "java.security.interfaces.DSAPublicKey" +
59f4c0
-                "|java.security.interfaces.DSAPrivateKey";
59f4c0
-        attrs.put("SupportedKeyClasses", dsaKeyClasses);
59f4c0
-        attrs.put("ImplementedIn", "Software");
59f4c0
-
59f4c0
-        attrs.put("KeySize", "1024"); // for NONE and SHA1 DSA signatures
59f4c0
-
59f4c0
-        addWithAlias(p, "Signature", "SHA1withDSA",
59f4c0
-                "sun.security.provider.DSA$SHA1withDSA", attrs);
59f4c0
-        addWithAlias(p, "Signature", "NONEwithDSA",
59f4c0
-                "sun.security.provider.DSA$RawDSA", attrs);
59f4c0
-
59f4c0
-        // for DSA signatures with 224/256-bit digests
59f4c0
-        attrs.put("KeySize", "2048");
59f4c0
-
59f4c0
-        addWithAlias(p, "Signature", "SHA224withDSA",
59f4c0
-                "sun.security.provider.DSA$SHA224withDSA", attrs);
59f4c0
-        addWithAlias(p, "Signature", "SHA256withDSA",
59f4c0
-                "sun.security.provider.DSA$SHA256withDSA", attrs);
59f4c0
-
59f4c0
-        addWithAlias(p, "Signature", "SHA3-224withDSA",
59f4c0
-                "sun.security.provider.DSA$SHA3_224withDSA", attrs);
59f4c0
-        addWithAlias(p, "Signature", "SHA3-256withDSA",
59f4c0
-                "sun.security.provider.DSA$SHA3_256withDSA", attrs);
59f4c0
-
59f4c0
-        attrs.put("KeySize", "3072"); // for DSA sig using 384/512-bit digests
59f4c0
-
59f4c0
-        addWithAlias(p, "Signature", "SHA384withDSA",
59f4c0
-                "sun.security.provider.DSA$SHA384withDSA", attrs);
59f4c0
-        addWithAlias(p, "Signature", "SHA512withDSA",
59f4c0
-                "sun.security.provider.DSA$SHA512withDSA", attrs);
59f4c0
-        addWithAlias(p, "Signature", "SHA3-384withDSA",
59f4c0
-                "sun.security.provider.DSA$SHA3_384withDSA", attrs);
59f4c0
-        addWithAlias(p, "Signature", "SHA3-512withDSA",
59f4c0
-                "sun.security.provider.DSA$SHA3_512withDSA", attrs);
59f4c0
-
59f4c0
-        attrs.remove("KeySize");
59f4c0
-
59f4c0
-        add(p, "Signature", "SHA1withDSAinP1363Format",
59f4c0
-                "sun.security.provider.DSA$SHA1withDSAinP1363Format");
59f4c0
-        add(p, "Signature", "NONEwithDSAinP1363Format",
59f4c0
-                "sun.security.provider.DSA$RawDSAinP1363Format");
59f4c0
-        add(p, "Signature", "SHA224withDSAinP1363Format",
59f4c0
-                "sun.security.provider.DSA$SHA224withDSAinP1363Format");
59f4c0
-        add(p, "Signature", "SHA256withDSAinP1363Format",
59f4c0
-                "sun.security.provider.DSA$SHA256withDSAinP1363Format");
59f4c0
-        add(p, "Signature", "SHA384withDSAinP1363Format",
59f4c0
-                "sun.security.provider.DSA$SHA384withDSAinP1363Format");
59f4c0
-        add(p, "Signature", "SHA512withDSAinP1363Format",
59f4c0
-                "sun.security.provider.DSA$SHA512withDSAinP1363Format");
59f4c0
-        add(p, "Signature", "SHA3-224withDSAinP1363Format",
59f4c0
-                "sun.security.provider.DSA$SHA3_224withDSAinP1363Format");
59f4c0
-        add(p, "Signature", "SHA3-256withDSAinP1363Format",
59f4c0
-                "sun.security.provider.DSA$SHA3_256withDSAinP1363Format");
59f4c0
-        add(p, "Signature", "SHA3-384withDSAinP1363Format",
59f4c0
-                "sun.security.provider.DSA$SHA3_384withDSAinP1363Format");
59f4c0
-        add(p, "Signature", "SHA3-512withDSAinP1363Format",
59f4c0
-                "sun.security.provider.DSA$SHA3_512withDSAinP1363Format");
59f4c0
-        /*
59f4c0
-         *  Key Pair Generator engines
59f4c0
-         */
59f4c0
-        attrs.clear();
59f4c0
-        attrs.put("ImplementedIn", "Software");
59f4c0
-        attrs.put("KeySize", "2048"); // for DSA KPG and APG only
f8e459
+        if (!systemFipsEnabled) {
f8e459
+            /*
f8e459
+             * SecureRandom engines
f8e459
+             */
f8e459
+            attrs.put("ThreadSafe", "true");
f8e459
+            if (NativePRNG.isAvailable()) {
f8e459
+                add(p, "SecureRandom", "NativePRNG",
f8e459
+                        "sun.security.provider.NativePRNG", attrs);
f8e459
+            }
f8e459
+            if (NativePRNG.Blocking.isAvailable()) {
f8e459
+                add(p, "SecureRandom", "NativePRNGBlocking",
f8e459
+                        "sun.security.provider.NativePRNG$Blocking", attrs);
f8e459
+            }
f8e459
+            if (NativePRNG.NonBlocking.isAvailable()) {
f8e459
+                add(p, "SecureRandom", "NativePRNGNonBlocking",
f8e459
+                        "sun.security.provider.NativePRNG$NonBlocking", attrs);
f8e459
+            }
f8e459
+            attrs.put("ImplementedIn", "Software");
f8e459
+            add(p, "SecureRandom", "DRBG", "sun.security.provider.DRBG", attrs);
f8e459
+            add(p, "SecureRandom", "SHA1PRNG",
f8e459
+                    "sun.security.provider.SecureRandom", attrs);
59f4c0
 
59f4c0
-        String dsaKPGImplClass = "sun.security.provider.DSAKeyPairGenerator$";
59f4c0
-        dsaKPGImplClass += (useLegacyDSA? "Legacy" : "Current");
59f4c0
-        addWithAlias(p, "KeyPairGenerator", "DSA", dsaKPGImplClass, attrs);
f8e459
+            /*
f8e459
+             * Signature engines
f8e459
+             */
f8e459
+            attrs.clear();
f8e459
+            String dsaKeyClasses = "java.security.interfaces.DSAPublicKey" +
f8e459
+                    "|java.security.interfaces.DSAPrivateKey";
f8e459
+            attrs.put("SupportedKeyClasses", dsaKeyClasses);
f8e459
+            attrs.put("ImplementedIn", "Software");
f8e459
+
f8e459
+            attrs.put("KeySize", "1024"); // for NONE and SHA1 DSA signatures
f8e459
+
f8e459
+            addWithAlias(p, "Signature", "SHA1withDSA",
f8e459
+                    "sun.security.provider.DSA$SHA1withDSA", attrs);
f8e459
+            addWithAlias(p, "Signature", "NONEwithDSA",
f8e459
+                    "sun.security.provider.DSA$RawDSA", attrs);
f8e459
+
f8e459
+            // for DSA signatures with 224/256-bit digests
f8e459
+            attrs.put("KeySize", "2048");
f8e459
+
f8e459
+            addWithAlias(p, "Signature", "SHA224withDSA",
f8e459
+                    "sun.security.provider.DSA$SHA224withDSA", attrs);
f8e459
+            addWithAlias(p, "Signature", "SHA256withDSA",
f8e459
+                    "sun.security.provider.DSA$SHA256withDSA", attrs);
f8e459
+
f8e459
+            addWithAlias(p, "Signature", "SHA3-224withDSA",
f8e459
+                    "sun.security.provider.DSA$SHA3_224withDSA", attrs);
f8e459
+            addWithAlias(p, "Signature", "SHA3-256withDSA",
f8e459
+                    "sun.security.provider.DSA$SHA3_256withDSA", attrs);
f8e459
+
f8e459
+            attrs.put("KeySize", "3072"); // for DSA sig using 384/512-bit digests
f8e459
+
f8e459
+            addWithAlias(p, "Signature", "SHA384withDSA",
f8e459
+                    "sun.security.provider.DSA$SHA384withDSA", attrs);
f8e459
+            addWithAlias(p, "Signature", "SHA512withDSA",
f8e459
+                    "sun.security.provider.DSA$SHA512withDSA", attrs);
f8e459
+            addWithAlias(p, "Signature", "SHA3-384withDSA",
f8e459
+                    "sun.security.provider.DSA$SHA3_384withDSA", attrs);
f8e459
+            addWithAlias(p, "Signature", "SHA3-512withDSA",
f8e459
+                    "sun.security.provider.DSA$SHA3_512withDSA", attrs);
f8e459
+
f8e459
+            attrs.remove("KeySize");
f8e459
+
f8e459
+            add(p, "Signature", "SHA1withDSAinP1363Format",
f8e459
+                    "sun.security.provider.DSA$SHA1withDSAinP1363Format");
f8e459
+            add(p, "Signature", "NONEwithDSAinP1363Format",
f8e459
+                    "sun.security.provider.DSA$RawDSAinP1363Format");
f8e459
+            add(p, "Signature", "SHA224withDSAinP1363Format",
f8e459
+                    "sun.security.provider.DSA$SHA224withDSAinP1363Format");
f8e459
+            add(p, "Signature", "SHA256withDSAinP1363Format",
f8e459
+                    "sun.security.provider.DSA$SHA256withDSAinP1363Format");
f8e459
+            add(p, "Signature", "SHA384withDSAinP1363Format",
f8e459
+                    "sun.security.provider.DSA$SHA384withDSAinP1363Format");
f8e459
+            add(p, "Signature", "SHA512withDSAinP1363Format",
f8e459
+                    "sun.security.provider.DSA$SHA512withDSAinP1363Format");
f8e459
+            add(p, "Signature", "SHA3-224withDSAinP1363Format",
f8e459
+                    "sun.security.provider.DSA$SHA3_224withDSAinP1363Format");
f8e459
+            add(p, "Signature", "SHA3-256withDSAinP1363Format",
f8e459
+                    "sun.security.provider.DSA$SHA3_256withDSAinP1363Format");
f8e459
+            add(p, "Signature", "SHA3-384withDSAinP1363Format",
f8e459
+                    "sun.security.provider.DSA$SHA3_384withDSAinP1363Format");
f8e459
+            add(p, "Signature", "SHA3-512withDSAinP1363Format",
f8e459
+                    "sun.security.provider.DSA$SHA3_512withDSAinP1363Format");
f8e459
+            /*
f8e459
+             *  Key Pair Generator engines
f8e459
+             */
f8e459
+            attrs.clear();
f8e459
+            attrs.put("ImplementedIn", "Software");
f8e459
+            attrs.put("KeySize", "2048"); // for DSA KPG and APG only
59f4c0
 
59f4c0
-        /*
59f4c0
-         * Algorithm Parameter Generator engines
59f4c0
-         */
59f4c0
-        addWithAlias(p, "AlgorithmParameterGenerator", "DSA",
59f4c0
-                "sun.security.provider.DSAParameterGenerator", attrs);
59f4c0
-        attrs.remove("KeySize");
f8e459
+            String dsaKPGImplClass = "sun.security.provider.DSAKeyPairGenerator$";
f8e459
+            dsaKPGImplClass += (useLegacyDSA? "Legacy" : "Current");
f8e459
+            addWithAlias(p, "KeyPairGenerator", "DSA", dsaKPGImplClass, attrs);
59f4c0
 
59f4c0
-        /*
59f4c0
-         * Algorithm Parameter engines
59f4c0
-         */
59f4c0
-        addWithAlias(p, "AlgorithmParameters", "DSA",
59f4c0
-                "sun.security.provider.DSAParameters", attrs);
f8e459
+            /*
f8e459
+             * Algorithm Parameter Generator engines
f8e459
+             */
f8e459
+            addWithAlias(p, "AlgorithmParameterGenerator", "DSA",
f8e459
+                    "sun.security.provider.DSAParameterGenerator", attrs);
f8e459
+            attrs.remove("KeySize");
59f4c0
 
59f4c0
-        /*
59f4c0
-         * Key factories
59f4c0
-         */
59f4c0
-        addWithAlias(p, "KeyFactory", "DSA",
59f4c0
-                "sun.security.provider.DSAKeyFactory", attrs);
f8e459
+            /*
f8e459
+             * Algorithm Parameter engines
f8e459
+             */
f8e459
+            addWithAlias(p, "AlgorithmParameters", "DSA",
f8e459
+                    "sun.security.provider.DSAParameters", attrs);
59f4c0
 
59f4c0
-        /*
59f4c0
-         * Digest engines
59f4c0
-         */
59f4c0
-        add(p, "MessageDigest", "MD2", "sun.security.provider.MD2", attrs);
59f4c0
-        add(p, "MessageDigest", "MD5", "sun.security.provider.MD5", attrs);
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA-1", "sun.security.provider.SHA",
59f4c0
-                attrs);
f8e459
+            /*
f8e459
+             * Key factories
f8e459
+             */
f8e459
+            addWithAlias(p, "KeyFactory", "DSA",
f8e459
+                    "sun.security.provider.DSAKeyFactory", attrs);
59f4c0
 
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA-224",
59f4c0
-                "sun.security.provider.SHA2$SHA224", attrs);
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA-256",
59f4c0
-                "sun.security.provider.SHA2$SHA256", attrs);
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA-384",
59f4c0
-                "sun.security.provider.SHA5$SHA384", attrs);
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA-512",
59f4c0
-                "sun.security.provider.SHA5$SHA512", attrs);
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA-512/224",
59f4c0
-                "sun.security.provider.SHA5$SHA512_224", attrs);
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA-512/256",
59f4c0
-                "sun.security.provider.SHA5$SHA512_256", attrs);
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA3-224",
59f4c0
-                "sun.security.provider.SHA3$SHA224", attrs);
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA3-256",
59f4c0
-                "sun.security.provider.SHA3$SHA256", attrs);
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA3-384",
59f4c0
-                "sun.security.provider.SHA3$SHA384", attrs);
59f4c0
-        addWithAlias(p, "MessageDigest", "SHA3-512",
59f4c0
-                "sun.security.provider.SHA3$SHA512", attrs);
f8e459
+            /*
f8e459
+             * Digest engines
f8e459
+             */
f8e459
+            add(p, "MessageDigest", "MD2", "sun.security.provider.MD2", attrs);
f8e459
+            add(p, "MessageDigest", "MD5", "sun.security.provider.MD5", attrs);
f8e459
+            addWithAlias(p, "MessageDigest", "SHA-1", "sun.security.provider.SHA",
f8e459
+                    attrs);
f8e459
+
f8e459
+            addWithAlias(p, "MessageDigest", "SHA-224",
f8e459
+                    "sun.security.provider.SHA2$SHA224", attrs);
f8e459
+            addWithAlias(p, "MessageDigest", "SHA-256",
f8e459
+                    "sun.security.provider.SHA2$SHA256", attrs);
f8e459
+            addWithAlias(p, "MessageDigest", "SHA-384",
f8e459
+                    "sun.security.provider.SHA5$SHA384", attrs);
f8e459
+            addWithAlias(p, "MessageDigest", "SHA-512",
f8e459
+                    "sun.security.provider.SHA5$SHA512", attrs);
f8e459
+            addWithAlias(p, "MessageDigest", "SHA-512/224",
f8e459
+                    "sun.security.provider.SHA5$SHA512_224", attrs);
f8e459
+            addWithAlias(p, "MessageDigest", "SHA-512/256",
f8e459
+                    "sun.security.provider.SHA5$SHA512_256", attrs);
f8e459
+            addWithAlias(p, "MessageDigest", "SHA3-224",
f8e459
+                    "sun.security.provider.SHA3$SHA224", attrs);
f8e459
+            addWithAlias(p, "MessageDigest", "SHA3-256",
f8e459
+                    "sun.security.provider.SHA3$SHA256", attrs);
f8e459
+            addWithAlias(p, "MessageDigest", "SHA3-384",
f8e459
+                    "sun.security.provider.SHA3$SHA384", attrs);
f8e459
+            addWithAlias(p, "MessageDigest", "SHA3-512",
f8e459
+                    "sun.security.provider.SHA3$SHA512", attrs);
59f4c0
+        }
f8e459
 
f8e459
         /*
f8e459
          * Certificates
59f4c0
diff --git openjdk.orig/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
59f4c0
index 8c9e4f9dbe6..883dc04758e 100644
59f4c0
--- openjdk.orig/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
f8e459
+++ openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
f8e459
@@ -38,6 +38,7 @@ import java.util.HashMap;
f8e459
 import java.util.Iterator;
f8e459
 import java.util.List;
f8e459
 
f8e459
+import jdk.internal.access.SharedSecrets;
f8e459
 import sun.security.ec.ed.EdDSAAlgorithmParameters;
f8e459
 import sun.security.ec.ed.EdDSAKeyFactory;
f8e459
 import sun.security.ec.ed.EdDSAKeyPairGenerator;
f8e459
@@ -56,6 +57,10 @@ public final class SunEC extends Provider {
f8e459
 
f8e459
     private static final long serialVersionUID = -2279741672933606418L;
f8e459
 
f8e459
+    private static final boolean systemFipsEnabled =
f8e459
+            SharedSecrets.getJavaSecuritySystemConfiguratorAccess()
f8e459
+            .isSystemFipsEnabled();
f8e459
+
f8e459
     private static class ProviderServiceA extends ProviderService {
f8e459
         ProviderServiceA(Provider p, String type, String algo, String cn,
f8e459
             HashMap<String, String> attrs) {
f8e459
@@ -249,85 +254,86 @@ public final class SunEC extends Provider {
f8e459
 
f8e459
         putXDHEntries();
f8e459
         putEdDSAEntries();
f8e459
-
f8e459
-        /*
f8e459
-         * Signature engines
f8e459
-         */
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-            "NONEwithECDSA", "sun.security.ec.ECDSASignature$Raw",
f8e459
-            null, ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "SHA1withECDSA", "sun.security.ec.ECDSASignature$SHA1",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "SHA224withECDSA", "sun.security.ec.ECDSASignature$SHA224",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "SHA256withECDSA", "sun.security.ec.ECDSASignature$SHA256",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "SHA384withECDSA", "sun.security.ec.ECDSASignature$SHA384",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "SHA512withECDSA", "sun.security.ec.ECDSASignature$SHA512",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "SHA3-224withECDSA", "sun.security.ec.ECDSASignature$SHA3_224",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "SHA3-256withECDSA", "sun.security.ec.ECDSASignature$SHA3_256",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "SHA3-384withECDSA", "sun.security.ec.ECDSASignature$SHA3_384",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "SHA3-512withECDSA", "sun.security.ec.ECDSASignature$SHA3_512",
f8e459
-            ATTRS));
f8e459
-
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-             "NONEwithECDSAinP1363Format",
f8e459
-             "sun.security.ec.ECDSASignature$RawinP1363Format"));
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-             "SHA1withECDSAinP1363Format",
f8e459
-             "sun.security.ec.ECDSASignature$SHA1inP1363Format"));
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-             "SHA224withECDSAinP1363Format",
f8e459
-             "sun.security.ec.ECDSASignature$SHA224inP1363Format"));
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-             "SHA256withECDSAinP1363Format",
f8e459
-             "sun.security.ec.ECDSASignature$SHA256inP1363Format"));
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-            "SHA384withECDSAinP1363Format",
f8e459
-            "sun.security.ec.ECDSASignature$SHA384inP1363Format"));
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-            "SHA512withECDSAinP1363Format",
f8e459
-            "sun.security.ec.ECDSASignature$SHA512inP1363Format"));
f8e459
-
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-             "SHA3-224withECDSAinP1363Format",
f8e459
-             "sun.security.ec.ECDSASignature$SHA3_224inP1363Format"));
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-             "SHA3-256withECDSAinP1363Format",
f8e459
-             "sun.security.ec.ECDSASignature$SHA3_256inP1363Format"));
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-            "SHA3-384withECDSAinP1363Format",
f8e459
-            "sun.security.ec.ECDSASignature$SHA3_384inP1363Format"));
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-            "SHA3-512withECDSAinP1363Format",
f8e459
-            "sun.security.ec.ECDSASignature$SHA3_512inP1363Format"));
f8e459
-
f8e459
-        /*
f8e459
-         *  Key Pair Generator engine
f8e459
-         */
f8e459
-        putService(new ProviderService(this, "KeyPairGenerator",
f8e459
-            "EC", "sun.security.ec.ECKeyPairGenerator",
f8e459
-            List.of("EllipticCurve"), ATTRS));
f8e459
-
f8e459
-        /*
f8e459
-         * Key Agreement engine
f8e459
-         */
f8e459
-        putService(new ProviderService(this, "KeyAgreement",
f8e459
-            "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS));
f8e459
+        if (!systemFipsEnabled) {
f8e459
+            /*
f8e459
+             * Signature engines
f8e459
+             */
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                "NONEwithECDSA", "sun.security.ec.ECDSASignature$Raw",
f8e459
+                null, ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "SHA1withECDSA", "sun.security.ec.ECDSASignature$SHA1",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "SHA224withECDSA", "sun.security.ec.ECDSASignature$SHA224",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "SHA256withECDSA", "sun.security.ec.ECDSASignature$SHA256",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "SHA384withECDSA", "sun.security.ec.ECDSASignature$SHA384",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "SHA512withECDSA", "sun.security.ec.ECDSASignature$SHA512",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "SHA3-224withECDSA", "sun.security.ec.ECDSASignature$SHA3_224",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "SHA3-256withECDSA", "sun.security.ec.ECDSASignature$SHA3_256",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "SHA3-384withECDSA", "sun.security.ec.ECDSASignature$SHA3_384",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "SHA3-512withECDSA", "sun.security.ec.ECDSASignature$SHA3_512",
f8e459
+                ATTRS));
f8e459
+
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                 "NONEwithECDSAinP1363Format",
f8e459
+                 "sun.security.ec.ECDSASignature$RawinP1363Format"));
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                 "SHA1withECDSAinP1363Format",
f8e459
+                 "sun.security.ec.ECDSASignature$SHA1inP1363Format"));
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                 "SHA224withECDSAinP1363Format",
f8e459
+                 "sun.security.ec.ECDSASignature$SHA224inP1363Format"));
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                 "SHA256withECDSAinP1363Format",
f8e459
+                 "sun.security.ec.ECDSASignature$SHA256inP1363Format"));
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                "SHA384withECDSAinP1363Format",
f8e459
+                "sun.security.ec.ECDSASignature$SHA384inP1363Format"));
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                "SHA512withECDSAinP1363Format",
f8e459
+                "sun.security.ec.ECDSASignature$SHA512inP1363Format"));
f8e459
+
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                 "SHA3-224withECDSAinP1363Format",
f8e459
+                 "sun.security.ec.ECDSASignature$SHA3_224inP1363Format"));
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                 "SHA3-256withECDSAinP1363Format",
f8e459
+                 "sun.security.ec.ECDSASignature$SHA3_256inP1363Format"));
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                "SHA3-384withECDSAinP1363Format",
f8e459
+                "sun.security.ec.ECDSASignature$SHA3_384inP1363Format"));
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                "SHA3-512withECDSAinP1363Format",
f8e459
+                "sun.security.ec.ECDSASignature$SHA3_512inP1363Format"));
f8e459
+
f8e459
+            /*
f8e459
+             *  Key Pair Generator engine
f8e459
+             */
f8e459
+            putService(new ProviderService(this, "KeyPairGenerator",
f8e459
+                "EC", "sun.security.ec.ECKeyPairGenerator",
f8e459
+                List.of("EllipticCurve"), ATTRS));
f8e459
+
f8e459
+            /*
f8e459
+             * Key Agreement engine
f8e459
+             */
f8e459
+            putService(new ProviderService(this, "KeyAgreement",
f8e459
+                "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS));
f8e459
+        }
f8e459
     }
f8e459
 
f8e459
     private void putXDHEntries() {
f8e459
@@ -344,23 +350,25 @@ public final class SunEC extends Provider {
f8e459
             "X448", "sun.security.ec.XDHKeyFactory.X448",
f8e459
             ATTRS));
f8e459
 
f8e459
-        putService(new ProviderService(this, "KeyPairGenerator",
f8e459
-            "XDH", "sun.security.ec.XDHKeyPairGenerator", null, ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "KeyPairGenerator",
f8e459
-            "X25519", "sun.security.ec.XDHKeyPairGenerator.X25519",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "KeyPairGenerator",
f8e459
-            "X448", "sun.security.ec.XDHKeyPairGenerator.X448",
f8e459
-            ATTRS));
f8e459
-
f8e459
-        putService(new ProviderService(this, "KeyAgreement",
f8e459
-            "XDH", "sun.security.ec.XDHKeyAgreement", null, ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "KeyAgreement",
f8e459
-            "X25519", "sun.security.ec.XDHKeyAgreement.X25519",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "KeyAgreement",
f8e459
-            "X448", "sun.security.ec.XDHKeyAgreement.X448",
f8e459
-            ATTRS));
f8e459
+        if (!systemFipsEnabled) {
f8e459
+            putService(new ProviderService(this, "KeyPairGenerator",
f8e459
+                "XDH", "sun.security.ec.XDHKeyPairGenerator", null, ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "KeyPairGenerator",
f8e459
+                "X25519", "sun.security.ec.XDHKeyPairGenerator.X25519",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "KeyPairGenerator",
f8e459
+                "X448", "sun.security.ec.XDHKeyPairGenerator.X448",
f8e459
+                ATTRS));
f8e459
+
f8e459
+            putService(new ProviderService(this, "KeyAgreement",
f8e459
+                "XDH", "sun.security.ec.XDHKeyAgreement", null, ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "KeyAgreement",
f8e459
+                "X25519", "sun.security.ec.XDHKeyAgreement.X25519",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "KeyAgreement",
f8e459
+                "X448", "sun.security.ec.XDHKeyAgreement.X448",
f8e459
+                ATTRS));
f8e459
+        }
f8e459
     }
f8e459
 
f8e459
     private void putEdDSAEntries() {
f8e459
@@ -375,21 +383,23 @@ public final class SunEC extends Provider {
f8e459
         putService(new ProviderServiceA(this, "KeyFactory",
f8e459
             "Ed448", "sun.security.ec.ed.EdDSAKeyFactory.Ed448", ATTRS));
f8e459
 
f8e459
-        putService(new ProviderService(this, "KeyPairGenerator",
f8e459
-            "EdDSA", "sun.security.ec.ed.EdDSAKeyPairGenerator", null, ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "KeyPairGenerator",
f8e459
-            "Ed25519", "sun.security.ec.ed.EdDSAKeyPairGenerator.Ed25519",
f8e459
-            ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "KeyPairGenerator",
f8e459
-            "Ed448", "sun.security.ec.ed.EdDSAKeyPairGenerator.Ed448",
f8e459
-            ATTRS));
f8e459
-
f8e459
-        putService(new ProviderService(this, "Signature",
f8e459
-            "EdDSA", "sun.security.ec.ed.EdDSASignature", null, ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "Ed25519", "sun.security.ec.ed.EdDSASignature.Ed25519", ATTRS));
f8e459
-        putService(new ProviderServiceA(this, "Signature",
f8e459
-            "Ed448", "sun.security.ec.ed.EdDSASignature.Ed448", ATTRS));
f8e459
+        if (!systemFipsEnabled) {
f8e459
+            putService(new ProviderService(this, "KeyPairGenerator",
f8e459
+                "EdDSA", "sun.security.ec.ed.EdDSAKeyPairGenerator", null, ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "KeyPairGenerator",
f8e459
+                "Ed25519", "sun.security.ec.ed.EdDSAKeyPairGenerator.Ed25519",
f8e459
+                ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "KeyPairGenerator",
f8e459
+                "Ed448", "sun.security.ec.ed.EdDSAKeyPairGenerator.Ed448",
f8e459
+                ATTRS));
f8e459
+
f8e459
+            putService(new ProviderService(this, "Signature",
f8e459
+                "EdDSA", "sun.security.ec.ed.EdDSASignature", null, ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "Ed25519", "sun.security.ec.ed.EdDSASignature.Ed25519", ATTRS));
f8e459
+            putService(new ProviderServiceA(this, "Signature",
f8e459
+                "Ed448", "sun.security.ec.ed.EdDSASignature.Ed448", ATTRS));
f8e459
+        }
f8e459
 
f8e459
     }
f8e459
 }