Title: [174331] trunk/Source/WebCore
Revision
174331
Author
cdu...@apple.com
Date
2014-10-05 16:27:48 -0700 (Sun, 05 Oct 2014)

Log Message

Use is<>() / downcast<>() for CryptoAlgorithmParameters subclasses
https://bugs.webkit.org/show_bug.cgi?id=137432

Reviewed by Benjamin Poulain.

Use is<>() / downcast<>() for CryptoAlgorithmParameters subclasses.

No new tests, no behavior change.

* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
* crypto/CryptoAlgorithmParameters.h:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
(WebCore::CryptoAlgorithmHMAC::verify):
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/parameters/CryptoAlgorithmAesCbcParams.h:
* crypto/parameters/CryptoAlgorithmAesKeyGenParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmHmacParams.h:
* crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
* crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHash.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* crypto/parameters/CryptoAlgorithmRsaSsaParams.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (174330 => 174331)


--- trunk/Source/WebCore/ChangeLog	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/ChangeLog	2014-10-05 23:27:48 UTC (rev 174331)
@@ -1,3 +1,49 @@
+2014-10-05  Christophe Dumez  <cdu...@apple.com>
+
+        Use is<>() / downcast<>() for CryptoAlgorithmParameters subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=137432
+
+        Reviewed by Benjamin Poulain.
+
+        Use is<>() / downcast<>() for CryptoAlgorithmParameters subclasses.
+
+        No new tests, no behavior change.
+
+        * bindings/js/JSCryptoKeySerializationJWK.cpp:
+        (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
+        * crypto/CryptoAlgorithmParameters.h:
+        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
+        (WebCore::CryptoAlgorithmAES_CBC::encrypt):
+        (WebCore::CryptoAlgorithmAES_CBC::decrypt):
+        (WebCore::CryptoAlgorithmAES_CBC::generateKey):
+        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
+        (WebCore::CryptoAlgorithmAES_KW::generateKey):
+        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
+        (WebCore::CryptoAlgorithmHMAC::sign):
+        (WebCore::CryptoAlgorithmHMAC::verify):
+        (WebCore::CryptoAlgorithmHMAC::generateKey):
+        (WebCore::CryptoAlgorithmHMAC::importKey):
+        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
+        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
+        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
+        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
+        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
+        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
+        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
+        (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
+        (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
+        (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
+        (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
+        * crypto/parameters/CryptoAlgorithmAesCbcParams.h:
+        * crypto/parameters/CryptoAlgorithmAesKeyGenParams.h:
+        * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
+        * crypto/parameters/CryptoAlgorithmHmacParams.h:
+        * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
+        * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHash.h:
+        * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
+        * crypto/parameters/CryptoAlgorithmRsaSsaParams.h:
+
 2014-10-05  Chris Fleizach  <cfleiz...@apple.com>
 
         AX: iOS8: Crash at -[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]

Modified: trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp (174330 => 174331)


--- trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp	2014-10-05 23:27:48 UTC (rev 174331)
@@ -232,11 +232,11 @@
         return false;
 
     if (algorithm->identifier() == CryptoAlgorithmIdentifier::HMAC)
-        return toCryptoAlgorithmHmacParams(*parameters).hash == toCryptoAlgorithmHmacParams(*suggestedParameters).hash;
+        return downcast<CryptoAlgorithmHmacParams>(*parameters).hash == downcast<CryptoAlgorithmHmacParams>(*suggestedParameters).hash;
     if (algorithm->identifier() == CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5
         || algorithm->identifier() == CryptoAlgorithmIdentifier::RSA_OAEP) {
-        CryptoAlgorithmRsaKeyParamsWithHash& rsaKeyParameters = toCryptoAlgorithmRsaKeyParamsWithHash(*parameters);
-        CryptoAlgorithmRsaKeyParamsWithHash& suggestedRSAKeyParameters = toCryptoAlgorithmRsaKeyParamsWithHash(*suggestedParameters);
+        CryptoAlgorithmRsaKeyParamsWithHash& rsaKeyParameters = downcast<CryptoAlgorithmRsaKeyParamsWithHash>(*parameters);
+        CryptoAlgorithmRsaKeyParamsWithHash& suggestedRSAKeyParameters = downcast<CryptoAlgorithmRsaKeyParamsWithHash>(*suggestedParameters);
         ASSERT(rsaKeyParameters.hasHash);
         if (suggestedRSAKeyParameters.hasHash)
             return suggestedRSAKeyParameters.hash == rsaKeyParameters.hash;

Modified: trunk/Source/WebCore/crypto/CryptoAlgorithmParameters.h (174330 => 174331)


--- trunk/Source/WebCore/crypto/CryptoAlgorithmParameters.h	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/CryptoAlgorithmParameters.h	2014-10-05 23:27:48 UTC (rev 174331)
@@ -27,6 +27,7 @@
 #define CryptoAlgorithmParameters_h
 
 #include <wtf/Noncopyable.h>
+#include <wtf/TypeCasts.h>
 
 #if ENABLE(SUBTLE_CRYPTO)
 
@@ -52,10 +53,12 @@
     virtual Class parametersClass() const { return Class::None; }
 };
 
-#define CRYPTO_ALGORITHM_PARAMETERS_CASTS(ToClassName) \
-    TYPE_CASTS_BASE(CryptoAlgorithm##ToClassName, CryptoAlgorithmParameters, parameters, parameters->parametersClass() == CryptoAlgorithmParameters::Class::ToClassName, parameters.parametersClass() == CryptoAlgorithmParameters::Class::ToClassName)
+} // namespace WebCore
 
-}
+#define SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(ToClassName) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::CryptoAlgorithm##ToClassName) \
+    static bool isType(const WebCore::CryptoAlgorithmParameters& parameters) { return parameters.parametersClass() == WebCore::CryptoAlgorithmParameters::Class::ToClassName; } \
+SPECIALIZE_TYPE_TRAITS_END()
 
 #endif // ENABLE(SUBTLE_CRYPTO)
 #endif // CryptoAlgorithmParameters_h

Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp (174330 => 174331)


--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp	2014-10-05 23:27:48 UTC (rev 174331)
@@ -67,7 +67,7 @@
 
 void CryptoAlgorithmAES_CBC::encrypt(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
 {
-    const CryptoAlgorithmAesCbcParams& aesCBCParameters = toCryptoAlgorithmAesCbcParams(parameters);
+    const CryptoAlgorithmAesCbcParams& aesCBCParameters = downcast<CryptoAlgorithmAesCbcParams>(parameters);
 
     if (!keyAlgorithmMatches(aesCBCParameters, key)) {
         ec = NOT_SUPPORTED_ERR;
@@ -79,7 +79,7 @@
 
 void CryptoAlgorithmAES_CBC::decrypt(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
 {
-    const CryptoAlgorithmAesCbcParams& aesCBCParameters = toCryptoAlgorithmAesCbcParams(parameters);
+    const CryptoAlgorithmAesCbcParams& aesCBCParameters = downcast<CryptoAlgorithmAesCbcParams>(parameters);
 
     if (!keyAlgorithmMatches(aesCBCParameters, key)) {
         ec = NOT_SUPPORTED_ERR;
@@ -91,7 +91,7 @@
 
 void CryptoAlgorithmAES_CBC::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsage usages, KeyOrKeyPairCallback callback, VoidCallback failureCallback, ExceptionCode&)
 {
-    const CryptoAlgorithmAesKeyGenParams& aesParameters = toCryptoAlgorithmAesKeyGenParams(parameters);
+    const CryptoAlgorithmAesKeyGenParams& aesParameters = downcast<CryptoAlgorithmAesKeyGenParams>(parameters);
 
     RefPtr<CryptoKeyAES> result = CryptoKeyAES::generate(CryptoAlgorithmIdentifier::AES_CBC, aesParameters.length, extractable, usages);
     if (!result) {

Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp (174330 => 174331)


--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp	2014-10-05 23:27:48 UTC (rev 174331)
@@ -86,7 +86,7 @@
 
 void CryptoAlgorithmAES_KW::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsage usages, KeyOrKeyPairCallback callback, VoidCallback failureCallback, ExceptionCode&)
 {
-    const CryptoAlgorithmAesKeyGenParams& aesParameters = toCryptoAlgorithmAesKeyGenParams(parameters);
+    const CryptoAlgorithmAesKeyGenParams& aesParameters = downcast<CryptoAlgorithmAesKeyGenParams>(parameters);
 
     RefPtr<CryptoKeyAES> result = CryptoKeyAES::generate(CryptoAlgorithmIdentifier::AES_KW, aesParameters.length, extractable, usages);
     if (!result) {

Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp (174330 => 174331)


--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp	2014-10-05 23:27:48 UTC (rev 174331)
@@ -70,7 +70,7 @@
 
 void CryptoAlgorithmHMAC::sign(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
 {
-    const CryptoAlgorithmHmacParams& hmacParameters = toCryptoAlgorithmHmacParams(parameters);
+    const CryptoAlgorithmHmacParams& hmacParameters = downcast<CryptoAlgorithmHmacParams>(parameters);
 
     if (!keyAlgorithmMatches(hmacParameters, key)) {
         ec = NOT_SUPPORTED_ERR;
@@ -82,7 +82,7 @@
 
 void CryptoAlgorithmHMAC::verify(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& expectedSignature, const CryptoOperationData& data, BoolCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
 {
-    const CryptoAlgorithmHmacParams& hmacParameters = toCryptoAlgorithmHmacParams(parameters);
+    const CryptoAlgorithmHmacParams& hmacParameters = downcast<CryptoAlgorithmHmacParams>(parameters);
 
     if (!keyAlgorithmMatches(hmacParameters, key)) {
         ec = NOT_SUPPORTED_ERR;
@@ -94,7 +94,7 @@
 
 void CryptoAlgorithmHMAC::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsage usages, KeyOrKeyPairCallback callback, VoidCallback failureCallback, ExceptionCode&)
 {
-    const CryptoAlgorithmHmacKeyParams& hmacParameters = toCryptoAlgorithmHmacKeyParams(parameters);
+    const CryptoAlgorithmHmacKeyParams& hmacParameters = downcast<CryptoAlgorithmHmacKeyParams>(parameters);
 
     RefPtr<CryptoKeyHMAC> result = CryptoKeyHMAC::generate(hmacParameters.hasLength ? hmacParameters.length : 0, hmacParameters.hash, extractable, usages);
     if (!result) {
@@ -113,7 +113,7 @@
     }
     const CryptoKeyDataOctetSequence& keyDataOctetSequence = toCryptoKeyDataOctetSequence(keyData);
 
-    const CryptoAlgorithmHmacParams& hmacParameters = toCryptoAlgorithmHmacParams(parameters);
+    const CryptoAlgorithmHmacParams& hmacParameters = downcast<CryptoAlgorithmHmacParams>(parameters);
 
     RefPtr<CryptoKeyHMAC> result = CryptoKeyHMAC::create(keyDataOctetSequence.octetSequence(), hmacParameters.hash, extractable, usage);
     callback(*result);

Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp (174330 => 174331)


--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp	2014-10-05 23:27:48 UTC (rev 174331)
@@ -86,7 +86,7 @@
 
 void CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsage usages, KeyOrKeyPairCallback callback, VoidCallback failureCallback, ExceptionCode&)
 {
-    const CryptoAlgorithmRsaKeyGenParams& rsaParameters = toCryptoAlgorithmRsaKeyGenParams(parameters);
+    const CryptoAlgorithmRsaKeyGenParams& rsaParameters = downcast<CryptoAlgorithmRsaKeyGenParams>(parameters);
 
     auto keyPairCallback = [callback](CryptoKeyPair& pair) {
         callback(nullptr, &pair);

Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp (174330 => 174331)


--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp	2014-10-05 23:27:48 UTC (rev 174331)
@@ -72,7 +72,7 @@
 
 void CryptoAlgorithmRSASSA_PKCS1_v1_5::sign(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
 {
-    const CryptoAlgorithmRsaSsaParams& rsaSSAParameters = toCryptoAlgorithmRsaSsaParams(parameters);
+    const CryptoAlgorithmRsaSsaParams& rsaSSAParameters = downcast<CryptoAlgorithmRsaSsaParams>(parameters);
 
     if (!keyAlgorithmMatches(rsaSSAParameters, key)) {
         ec = NOT_SUPPORTED_ERR;
@@ -84,7 +84,7 @@
 
 void CryptoAlgorithmRSASSA_PKCS1_v1_5::verify(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& signature, const CryptoOperationData& data, BoolCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
 {
-    const CryptoAlgorithmRsaSsaParams& rsaSSAParameters = toCryptoAlgorithmRsaSsaParams(parameters);
+    const CryptoAlgorithmRsaSsaParams& rsaSSAParameters = downcast<CryptoAlgorithmRsaSsaParams>(parameters);
 
     if (!keyAlgorithmMatches(rsaSSAParameters, key)) {
         ec = NOT_SUPPORTED_ERR;
@@ -96,7 +96,7 @@
 
 void CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsage usages, KeyOrKeyPairCallback callback, VoidCallback failureCallback, ExceptionCode&)
 {
-    const CryptoAlgorithmRsaKeyGenParams& rsaParameters = toCryptoAlgorithmRsaKeyGenParams(parameters);
+    const CryptoAlgorithmRsaKeyGenParams& rsaParameters = downcast<CryptoAlgorithmRsaKeyGenParams>(parameters);
 
     auto keyPairCallback = [callback](CryptoKeyPair& pair) {
         callback(nullptr, &pair);
@@ -107,7 +107,7 @@
 
 void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(const CryptoAlgorithmParameters& parameters, const CryptoKeyData& keyData, bool extractable, CryptoKeyUsage usage, KeyCallback callback, VoidCallback failureCallback, ExceptionCode&)
 {
-    const CryptoAlgorithmRsaKeyParamsWithHash& rsaKeyParameters = toCryptoAlgorithmRsaKeyParamsWithHash(parameters);
+    const CryptoAlgorithmRsaKeyParamsWithHash& rsaKeyParameters = downcast<CryptoAlgorithmRsaKeyParamsWithHash>(parameters);
     const CryptoKeyDataRSAComponents& rsaComponents = toCryptoKeyDataRSAComponents(keyData);
 
     RefPtr<CryptoKeyRSA> result = CryptoKeyRSA::create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5, rsaComponents, extractable, usage);

Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp (174330 => 174331)


--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp	2014-10-05 23:27:48 UTC (rev 174331)
@@ -72,7 +72,7 @@
 
 void CryptoAlgorithmRSA_OAEP::encrypt(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
 {
-    const CryptoAlgorithmRsaOaepParams& rsaOAEPParameters = toCryptoAlgorithmRsaOaepParams(parameters);
+    const CryptoAlgorithmRsaOaepParams& rsaOAEPParameters = downcast<CryptoAlgorithmRsaOaepParams>(parameters);
 
     if (!keyAlgorithmMatches(rsaOAEPParameters, key)) {
         ec = NOT_SUPPORTED_ERR;
@@ -84,7 +84,7 @@
 
 void CryptoAlgorithmRSA_OAEP::decrypt(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
 {
-    const CryptoAlgorithmRsaOaepParams& rsaOAEPParameters = toCryptoAlgorithmRsaOaepParams(parameters);
+    const CryptoAlgorithmRsaOaepParams& rsaOAEPParameters = downcast<CryptoAlgorithmRsaOaepParams>(parameters);
 
     if (!keyAlgorithmMatches(rsaOAEPParameters, key)) {
         ec = NOT_SUPPORTED_ERR;
@@ -96,7 +96,7 @@
 
 void CryptoAlgorithmRSA_OAEP::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsage usages, KeyOrKeyPairCallback callback, VoidCallback failureCallback, ExceptionCode&)
 {
-    const CryptoAlgorithmRsaKeyGenParams& rsaParameters = toCryptoAlgorithmRsaKeyGenParams(parameters);
+    const CryptoAlgorithmRsaKeyGenParams& rsaParameters = downcast<CryptoAlgorithmRsaKeyGenParams>(parameters);
 
     auto keyPairCallback = [callback](CryptoKeyPair& pair) {
         callback(nullptr, &pair);
@@ -107,7 +107,7 @@
 
 void CryptoAlgorithmRSA_OAEP::importKey(const CryptoAlgorithmParameters& parameters, const CryptoKeyData& keyData, bool extractable, CryptoKeyUsage usage, KeyCallback callback, VoidCallback failureCallback, ExceptionCode&)
 {
-    const CryptoAlgorithmRsaKeyParamsWithHash& rsaKeyParameters = toCryptoAlgorithmRsaKeyParamsWithHash(parameters);
+    const CryptoAlgorithmRsaKeyParamsWithHash& rsaKeyParameters = downcast<CryptoAlgorithmRsaKeyParamsWithHash>(parameters);
     const CryptoKeyDataRSAComponents& rsaComponents = toCryptoKeyDataRSAComponents(keyData);
 
     RefPtr<CryptoKeyRSA> result = CryptoKeyRSA::create(CryptoAlgorithmIdentifier::RSA_OAEP, rsaComponents, extractable, usage);

Modified: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h (174330 => 174331)


--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h	2014-10-05 23:27:48 UTC (rev 174331)
@@ -41,9 +41,9 @@
     virtual Class parametersClass() const override { return Class::AesCbcParams; }
 };
 
-CRYPTO_ALGORITHM_PARAMETERS_CASTS(AesCbcParams)
+} // namespace WebCore
 
-}
+SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(AesCbcParams)
 
 #endif // ENABLE(SUBTLE_CRYPTO)
 #endif // CryptoAlgorithmAesCbcParams_h

Modified: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyGenParams.h (174330 => 174331)


--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyGenParams.h	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyGenParams.h	2014-10-05 23:27:48 UTC (rev 174331)
@@ -40,9 +40,9 @@
     virtual Class parametersClass() const override { return Class::AesKeyGenParams; }
 };
 
-CRYPTO_ALGORITHM_PARAMETERS_CASTS(AesKeyGenParams)
+} // namespace WebCore
 
-}
+SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(AesKeyGenParams)
 
 #endif // ENABLE(SUBTLE_CRYPTO)
 #endif // CryptoAlgorithmAesKeyGenParams_h

Modified: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h (174330 => 174331)


--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h	2014-10-05 23:27:48 UTC (rev 174331)
@@ -51,9 +51,9 @@
     virtual Class parametersClass() const override { return Class::HmacKeyParams; }
 };
 
-CRYPTO_ALGORITHM_PARAMETERS_CASTS(HmacKeyParams)
+} // namespace WebCore
 
-}
+SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(HmacKeyParams)
 
 #endif // ENABLE(SUBTLE_CRYPTO)
 #endif // CryptoAlgorithmHmacKeyParams_h

Modified: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacParams.h (174330 => 174331)


--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacParams.h	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacParams.h	2014-10-05 23:27:48 UTC (rev 174331)
@@ -41,9 +41,9 @@
     virtual Class parametersClass() const override { return Class::HmacParams; }
 };
 
-CRYPTO_ALGORITHM_PARAMETERS_CASTS(HmacParams)
+} // namespace WebCore
 
-}
+SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(HmacParams)
 
 #endif // ENABLE(SUBTLE_CRYPTO)
 #endif // CryptoAlgorithmHmacParams_h

Modified: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h (174330 => 174331)


--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h	2014-10-05 23:27:48 UTC (rev 174331)
@@ -43,9 +43,9 @@
     virtual Class parametersClass() const override { return Class::RsaKeyGenParams; }
 };
 
-CRYPTO_ALGORITHM_PARAMETERS_CASTS(RsaKeyGenParams)
+} // namespace WebCore
 
-}
+SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaKeyGenParams)
 
 #endif // ENABLE(SUBTLE_CRYPTO)
 #endif // CryptoAlgorithmRsaKeyGenParams_h

Modified: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHash.h (174330 => 174331)


--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHash.h	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHash.h	2014-10-05 23:27:48 UTC (rev 174331)
@@ -50,9 +50,9 @@
     virtual Class parametersClass() const override { return Class::RsaKeyParamsWithHash; }
 };
 
-CRYPTO_ALGORITHM_PARAMETERS_CASTS(RsaKeyParamsWithHash)
+} // namespace WebCore
 
-}
+SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaKeyParamsWithHash)
 
 #endif // ENABLE(SUBTLE_CRYPTO)
 #endif // CryptoAlgorithmRsaKeyParamsWithHash_h

Modified: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h (174330 => 174331)


--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h	2014-10-05 23:27:48 UTC (rev 174331)
@@ -51,9 +51,9 @@
     virtual Class parametersClass() const override { return Class::RsaOaepParams; }
 };
 
-CRYPTO_ALGORITHM_PARAMETERS_CASTS(RsaOaepParams)
+} // namespace WebCore
 
-}
+SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaOaepParams)
 
 #endif // ENABLE(SUBTLE_CRYPTO)
 #endif // CryptoAlgorithmRsaOaepParams_h

Modified: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaSsaParams.h (174330 => 174331)


--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaSsaParams.h	2014-10-05 23:09:59 UTC (rev 174330)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaSsaParams.h	2014-10-05 23:27:48 UTC (rev 174331)
@@ -41,9 +41,9 @@
     virtual Class parametersClass() const override { return Class::RsaSsaParams; }
 };
 
-CRYPTO_ALGORITHM_PARAMETERS_CASTS(RsaSsaParams)
+} // namespace WebCore
 
-}
+SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaSsaParams)
 
 #endif // ENABLE(SUBTLE_CRYPTO)
 #endif // CryptoAlgorithmRsaSsaParams_h
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to