7169496: Problem with the SHA-224 support for SunMSCAPI provider
authorvaleriep
Fri, 18 May 2012 12:29:33 -0700
changeset 12700 9c9ad46c7c40
parent 12699 6142d1da5851
child 12701 c624acdf1852
7169496: Problem with the SHA-224 support for SunMSCAPI provider Summary: Remove SHA224withRSA signature from SunMSCAPI provider due to lack of windows support. Reviewed-by: vinnie
jdk/src/windows/classes/sun/security/mscapi/RSASignature.java
jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java
jdk/test/sun/security/mscapi/SignUsingNONEwithRSA.java
jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.java
--- a/jdk/src/windows/classes/sun/security/mscapi/RSASignature.java	Thu May 17 21:59:26 2012 -0700
+++ b/jdk/src/windows/classes/sun/security/mscapi/RSASignature.java	Fri May 18 12:29:33 2012 -0700
@@ -47,7 +47,6 @@
  *
  *  . "NONEwithRSA"
  *  . "SHA1withRSA"
- *  . "SHA224withRSA"
  *  . "SHA256withRSA"
  *  . "SHA384withRSA"
  *  . "SHA512withRSA"
@@ -58,7 +57,7 @@
  *
  * NOTE: NONEwithRSA must be supplied with a pre-computed message digest.
  *       Only the following digest algorithms are supported: MD5, SHA-1,
- *       SHA-224, SHA-256, SHA-384, SHA-512 and a special-purpose digest
+ *       SHA-256, SHA-384, SHA-512 and a special-purpose digest
  *       algorithm which is a concatenation of SHA-1 and MD5 digests.
  *
  * @since   1.6
@@ -181,8 +180,6 @@
                 setDigestName("SHA-512");
             } else if (offset == 16) {
                 setDigestName("MD5");
-            } else if (offset == 28) {
-                setDigestName("SHA-224");
             } else {
                 throw new SignatureException(
                     "Message digest length is not supported");
@@ -202,12 +199,6 @@
         }
     }
 
-    public static final class SHA224 extends RSASignature {
-        public SHA224() {
-            super("SHA-224");
-        }
-    }
-
     public static final class SHA256 extends RSASignature {
         public SHA256() {
             super("SHA-256");
--- a/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java	Thu May 17 21:59:26 2012 -0700
+++ b/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java	Fri May 18 12:29:33 2012 -0700
@@ -81,16 +81,12 @@
          */
         // NONEwithRSA must be supplied with a pre-computed message digest.
         // Only the following digest algorithms are supported: MD5, SHA-1,
-        // SHA-224, SHA-256, SHA-384, SHA-512 and a special-purpose digest
+        // SHA-256, SHA-384, SHA-512 and a special-purpose digest
         // algorithm which is a concatenation of SHA-1 and MD5 digests.
         map.put("Signature.NONEwithRSA",
             "sun.security.mscapi.RSASignature$Raw");
         map.put("Signature.SHA1withRSA",
             "sun.security.mscapi.RSASignature$SHA1");
-        map.put("Signature.SHA224withRSA",
-            "sun.security.mscapi.RSASignature$SHA224");
-        map.put("Alg.Alias.Signature.1.2.840.113549.1.1.14",     "SHA224withRSA");
-        map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.14", "SHA224withRSA");
         map.put("Signature.SHA256withRSA",
             "sun.security.mscapi.RSASignature$SHA256");
         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.11",     "SHA256withRSA");
@@ -115,8 +111,6 @@
             "sun.security.mscapi.Key");
         map.put("Signature.SHA1withRSA SupportedKeyClasses",
             "sun.security.mscapi.Key");
-        map.put("Signature.SHA224withRSA SupportedKeyClasses",
-            "sun.security.mscapi.Key");
         map.put("Signature.SHA256withRSA SupportedKeyClasses",
             "sun.security.mscapi.Key");
         map.put("Signature.SHA384withRSA SupportedKeyClasses",
--- a/jdk/test/sun/security/mscapi/SignUsingNONEwithRSA.java	Thu May 17 21:59:26 2012 -0700
+++ b/jdk/test/sun/security/mscapi/SignUsingNONEwithRSA.java	Fri May 18 12:29:33 2012 -0700
@@ -48,12 +48,6 @@
             0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30,
             0x31, 0x32, 0x33, 0x34, 0x35, 0x36
         },
-        // A SHA-224 hash
-        new byte[] {
-            0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10,
-            0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20,
-            0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28
-        },
         // A SHA-256 hash
         new byte[] {
             0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10,
--- a/jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.java	Thu May 17 21:59:26 2012 -0700
+++ b/jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.java	Fri May 18 12:29:33 2012 -0700
@@ -78,16 +78,12 @@
         generatedSignatures.add(signUsing("SHA256withRSA", privateKey));
         generatedSignatures.add(signUsing("SHA384withRSA", privateKey));
         generatedSignatures.add(signUsing("SHA512withRSA", privateKey));
-        generatedSignatures.add(signUsing("SHA224withRSA", privateKey));
-
 
         System.out.println("-------------------------------------------------");
 
         verifyUsing("SHA256withRSA", publicKey, generatedSignatures.get(0));
         verifyUsing("SHA384withRSA", publicKey, generatedSignatures.get(1));
         verifyUsing("SHA512withRSA", publicKey, generatedSignatures.get(2));
-        verifyUsing("SHA224withRSA", publicKey, generatedSignatures.get(3));
-
 
         System.out.println("-------------------------------------------------");
     }