Blame SOURCES/rh1995150-disable_non-fips_crypto.patch

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