Bug 1021601 - Remove SHA-224 support from WebCrypto API r=rbarnes
authorTim Taubert <ttaubert@mozilla.com>
Thu, 05 Jun 2014 22:42:45 +0200
changeset 187336 3efccd28317bfd51327f881913f4a566ff42333a
parent 187335 65f1eeeb742ce35d9d49403a5b0ebccbc8e0e8db
child 187337 33e00e8b000e6d020d7c8ec7094b0813165240d0
push id26917
push userryanvm@gmail.com
push dateSat, 07 Jun 2014 18:13:47 +0000
treeherdermozilla-central@a2f0e0619332 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrbarnes
bugs1021601
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1021601 - Remove SHA-224 support from WebCrypto API r=rbarnes
dom/crypto/HmacKeyAlgorithm.h
dom/crypto/KeyAlgorithm.cpp
dom/crypto/WebCryptoCommon.h
dom/crypto/WebCryptoTask.cpp
--- a/dom/crypto/HmacKeyAlgorithm.h
+++ b/dom/crypto/HmacKeyAlgorithm.h
@@ -28,17 +28,16 @@ public:
                    uint32_t aLength,
                    const nsString& aHash)
     : KeyAlgorithm(aGlobal, aName)
     , mHash(new KeyAlgorithm(aGlobal, aHash))
     , mLength(aLength)
   {
     switch (mHash->Mechanism()) {
       case CKM_SHA_1: mMechanism = CKM_SHA_1_HMAC; break;
-      case CKM_SHA224: mMechanism = CKM_SHA224_HMAC; break;
       case CKM_SHA256: mMechanism = CKM_SHA256_HMAC; break;
       case CKM_SHA384: mMechanism = CKM_SHA384_HMAC; break;
       case CKM_SHA512: mMechanism = CKM_SHA512_HMAC; break;
       default: mMechanism = UNKNOWN_CK_MECHANISM; break;
     }
   }
 
   ~HmacKeyAlgorithm()
--- a/dom/crypto/KeyAlgorithm.cpp
+++ b/dom/crypto/KeyAlgorithm.cpp
@@ -35,18 +35,16 @@ KeyAlgorithm::KeyAlgorithm(nsIGlobalObje
   if (mName.EqualsLiteral(WEBCRYPTO_ALG_AES_CBC)) {
     mMechanism = CKM_AES_CBC_PAD;
   } else if (mName.EqualsLiteral(WEBCRYPTO_ALG_AES_CTR)) {
     mMechanism = CKM_AES_CTR;
   } else if (mName.EqualsLiteral(WEBCRYPTO_ALG_AES_GCM)) {
     mMechanism = CKM_AES_GCM;
   } else if (mName.EqualsLiteral(WEBCRYPTO_ALG_SHA1)) {
     mMechanism = CKM_SHA_1;
-  } else if (mName.EqualsLiteral(WEBCRYPTO_ALG_SHA224)) {
-    mMechanism = CKM_SHA224;
   } else if (mName.EqualsLiteral(WEBCRYPTO_ALG_SHA256)) {
     mMechanism = CKM_SHA256;
   } else if (mName.EqualsLiteral(WEBCRYPTO_ALG_SHA384)) {
     mMechanism = CKM_SHA384;
   } else if (mName.EqualsLiteral(WEBCRYPTO_ALG_SHA512)) {
     mMechanism = CKM_SHA512;
   } else if (mName.EqualsLiteral(WEBCRYPTO_ALG_RSAES_PKCS1)) {
     mMechanism = CKM_RSA_PKCS;
--- a/dom/crypto/WebCryptoCommon.h
+++ b/dom/crypto/WebCryptoCommon.h
@@ -13,17 +13,16 @@
 #include "js/StructuredClone.h"
 
 // WebCrypto algorithm names
 #define WEBCRYPTO_ALG_AES_CBC       "AES-CBC"
 #define WEBCRYPTO_ALG_AES_CTR       "AES-CTR"
 #define WEBCRYPTO_ALG_AES_GCM       "AES-GCM"
 #define WEBCRYPTO_ALG_SHA1          "SHA-1"
 #define WEBCRYPTO_ALG_SHA256        "SHA-256"
-#define WEBCRYPTO_ALG_SHA224        "SHA-224"
 #define WEBCRYPTO_ALG_SHA384        "SHA-384"
 #define WEBCRYPTO_ALG_SHA512        "SHA-512"
 #define WEBCRYPTO_ALG_HMAC          "HMAC"
 #define WEBCRYPTO_ALG_RSAES_PKCS1   "RSAES-PKCS1-v1_5"
 #define WEBCRYPTO_ALG_RSASSA_PKCS1  "RSASSA-PKCS1-v1_5"
 
 // WebCrypto key formats
 #define WEBCRYPTO_KEY_FORMAT_RAW    "raw"
--- a/dom/crypto/WebCryptoTask.cpp
+++ b/dom/crypto/WebCryptoTask.cpp
@@ -484,18 +484,16 @@ public:
     // is RSASSA-PKCS1-v1_5, and that only happens if we've constructed
     // an RsaHashedKeyAlgorithm
     nsRefPtr<RsaHashedKeyAlgorithm> rsaAlg = static_cast<RsaHashedKeyAlgorithm*>(aKey.Algorithm());
     nsRefPtr<KeyAlgorithm> hashAlg = rsaAlg->Hash();
 
     switch (hashAlg->Mechanism()) {
       case CKM_SHA_1:
         mOidTag = SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION; break;
-      case CKM_SHA224:
-        mOidTag = SEC_OID_PKCS1_SHA224_WITH_RSA_ENCRYPTION; break;
       case CKM_SHA256:
         mOidTag = SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION; break;
       case CKM_SHA384:
         mOidTag = SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION; break;
       case CKM_SHA512:
         mOidTag = SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION; break;
       default: {
         mEarlyRv = NS_ERROR_DOM_NOT_SUPPORTED_ERR;
@@ -593,18 +591,16 @@ public:
     mEarlyRv = GetAlgorithmName(aCx, aAlgorithm, algName);
     if (NS_FAILED(mEarlyRv)) {
       mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
       return;
     }
 
     if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA1))   {
       mOidTag = SEC_OID_SHA1;
-    } else if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA224)) {
-      mOidTag = SEC_OID_SHA224;
     } else if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA256)) {
       mOidTag = SEC_OID_SHA256;
     } else if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA384)) {
       mOidTag = SEC_OID_SHA384;
     } else if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA512)) {
       mOidTag = SEC_OID_SHA512;
     } else {
       mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
@@ -1041,17 +1037,16 @@ public:
       }
 
       if (params.mLength.WasPassed()) {
         mLength = params.mLength.Value();
       } else {
         KeyAlgorithm hashAlg(global, hashName);
         switch (hashAlg.Mechanism()) {
           case CKM_SHA_1: mLength = 128; break;
-          case CKM_SHA224: mLength = 224; break;
           case CKM_SHA256: mLength = 256; break;
           case CKM_SHA384: mLength = 384; break;
           case CKM_SHA512: mLength = 512; break;
           default: mLength = 0; break;
         }
       }
 
       if (mLength == 0) {