Commit 2882324e authored by ap@apple.com's avatar ap@apple.com

Check WebCrypto parameter types when casting

https://bugs.webkit.org/show_bug.cgi?id=124297

Reviewed by Sam Weinig.

Also changed existing toCryptoXXX functions to use TYPE_CASTS_BASE mechanism.

* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey):
And sure enough, there was a bug caught by the added checks.

* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
* crypto/CryptoAlgorithmParameters.h:
(WebCore::CryptoAlgorithmParameters::ENUM_CLASS):
(WebCore::CryptoAlgorithmParameters::parametersClass):
* crypto/CryptoKey.h:
* crypto/CryptoKeyData.h:
* crypto/CryptoKeySerialization.h:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyDataOctetSequence.h:
(WebCore::isCryptoKeyDataOctetSequence):
* crypto/keys/CryptoKeyDataRSAComponents.h:
(WebCore::isCryptoKeyDataRSAComponents):
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.h:
* crypto/keys/CryptoKeySerializationRaw.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
(WebCore::CryptoAlgorithmHMAC::verify):
* crypto/parameters/CryptoAlgorithmAesCbcParams.h:
* crypto/parameters/CryptoAlgorithmAesKeyGenParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmHmacParams.h:
* crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
* crypto/parameters/CryptoAlgorithmRsaSsaKeyParams.h:
* crypto/parameters/CryptoAlgorithmRsaSsaParams.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dc8250ec
2013-11-13 Alexey Proskuryakov <ap@apple.com>
Check WebCrypto parameter types when casting
https://bugs.webkit.org/show_bug.cgi?id=124297
Reviewed by Sam Weinig.
Also changed existing toCryptoXXX functions to use TYPE_CASTS_BASE mechanism.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey):
And sure enough, there was a bug caught by the added checks.
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
* crypto/CryptoAlgorithmParameters.h:
(WebCore::CryptoAlgorithmParameters::ENUM_CLASS):
(WebCore::CryptoAlgorithmParameters::parametersClass):
* crypto/CryptoKey.h:
* crypto/CryptoKeyData.h:
* crypto/CryptoKeySerialization.h:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyDataOctetSequence.h:
(WebCore::isCryptoKeyDataOctetSequence):
* crypto/keys/CryptoKeyDataRSAComponents.h:
(WebCore::isCryptoKeyDataRSAComponents):
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.h:
* crypto/keys/CryptoKeySerializationRaw.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
(WebCore::CryptoAlgorithmHMAC::verify):
* crypto/parameters/CryptoAlgorithmAesCbcParams.h:
* crypto/parameters/CryptoAlgorithmAesKeyGenParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmHmacParams.h:
* crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
* crypto/parameters/CryptoAlgorithmRsaSsaKeyParams.h:
* crypto/parameters/CryptoAlgorithmRsaSsaParams.h:
2013-11-13 Alexey Proskuryakov <ap@apple.com>
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html is failing on Maverics release bot
......
......@@ -538,7 +538,7 @@ std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createPa
case CryptoAlgorithmIdentifier::AES_CFB:
return std::make_unique<CryptoAlgorithmParameters>();
case CryptoAlgorithmIdentifier::HMAC:
return createHmacKeyParams(exec, value);
return createHmacParams(exec, value);
case CryptoAlgorithmIdentifier::DH:
return std::make_unique<CryptoAlgorithmParameters>();
case CryptoAlgorithmIdentifier::SHA_1:
......
......@@ -212,10 +212,10 @@ bool JSCryptoKeySerializationJWK::reconcileAlgorithm(std::unique_ptr<CryptoAlgor
return false;
if (algorithm->identifier() == CryptoAlgorithmIdentifier::HMAC)
return static_cast<CryptoAlgorithmHmacParams&>(*parameters).hash == static_cast<CryptoAlgorithmHmacParams&>(*suggestedParameters).hash;
return toCryptoAlgorithmHmacParams(*parameters).hash == toCryptoAlgorithmHmacParams(*suggestedParameters).hash;
if (algorithm->identifier() == CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5) {
CryptoAlgorithmRsaSsaKeyParams& rsaSSAParameters = static_cast<CryptoAlgorithmRsaSsaKeyParams&>(*parameters);
CryptoAlgorithmRsaSsaKeyParams& suggestedRSASSAParameters = static_cast<CryptoAlgorithmRsaSsaKeyParams&>(*suggestedParameters);
CryptoAlgorithmRsaSsaKeyParams& rsaSSAParameters = toCryptoAlgorithmRsaSsaKeyParams(*parameters);
CryptoAlgorithmRsaSsaKeyParams& suggestedRSASSAParameters = toCryptoAlgorithmRsaSsaKeyParams(*suggestedParameters);
ASSERT(rsaSSAParameters.hasHash);
if (suggestedRSASSAParameters.hasHash)
return suggestedRSASSAParameters.hash == rsaSSAParameters.hash;
......
......@@ -37,8 +37,23 @@ class CryptoAlgorithmParameters {
public:
CryptoAlgorithmParameters() { }
virtual ~CryptoAlgorithmParameters() { }
ENUM_CLASS(Class) {
None,
AesCbcParams,
AesKeyGenParams,
HmacKeyParams,
HmacParams,
RsaKeyGenParams,
RsaSsaKeyParams,
RsaSsaParams
};
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)
}
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -68,6 +68,9 @@ private:
CryptoKeyUsage m_usages;
};
#define CRYPTO_KEY_TYPE_CASTS(ToClassName) \
TYPE_CASTS_BASE(ToClassName, CryptoKey, key, WebCore::is##ToClassName(*key), WebCore::is##ToClassName(key))
} // namespace WebCore
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -33,7 +33,7 @@
namespace WebCore {
class CryptoKeyData {
WTF_MAKE_NONCOPYABLE(CryptoKeyData);
WTF_MAKE_NONCOPYABLE(CryptoKeyData);
public:
ENUM_CLASS(Format) {
OctetSequence,
......@@ -52,6 +52,9 @@ private:
Format m_format;
};
#define CRYPTO_KEY_DATA_CASTS(ToClassName) \
TYPE_CASTS_BASE(ToClassName, CryptoKeyData, keyData, WebCore::is##ToClassName(*keyData), WebCore::is##ToClassName(keyData))
} // namespace WebCore
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -40,7 +40,7 @@ class CryptoKeyData;
typedef std::pair<const char*, size_t> CryptoOperationData;
class CryptoKeySerialization {
WTF_MAKE_NONCOPYABLE(CryptoKeySerialization);
WTF_MAKE_NONCOPYABLE(CryptoKeySerialization);
public:
CryptoKeySerialization() { }
virtual ~CryptoKeySerialization() { }
......
......@@ -58,7 +58,7 @@ CryptoAlgorithmIdentifier CryptoAlgorithmAES_CBC::identifier() const
void CryptoAlgorithmAES_CBC::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsage usages, std::unique_ptr<PromiseWrapper> promise, ExceptionCode&)
{
const CryptoAlgorithmAesKeyGenParams& aesParameters = static_cast<const CryptoAlgorithmAesKeyGenParams&>(parameters);
const CryptoAlgorithmAesKeyGenParams& aesParameters = toCryptoAlgorithmAesKeyGenParams(parameters);
RefPtr<CryptoKeyAES> result = CryptoKeyAES::generate(CryptoAlgorithmIdentifier::AES_CBC, aesParameters.length, extractable, usages);
if (!result) {
......
......@@ -59,7 +59,7 @@ CryptoAlgorithmIdentifier CryptoAlgorithmHMAC::identifier() const
void CryptoAlgorithmHMAC::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsage usages, std::unique_ptr<PromiseWrapper> promise, ExceptionCode&)
{
const CryptoAlgorithmHmacKeyParams& hmacParameters = static_cast<const CryptoAlgorithmHmacKeyParams&>(parameters);
const CryptoAlgorithmHmacKeyParams& hmacParameters = toCryptoAlgorithmHmacKeyParams(parameters);
RefPtr<CryptoKeyHMAC> result = CryptoKeyHMAC::generate(hmacParameters.hasLength ? hmacParameters.length : 0, hmacParameters.hash, extractable, usages);
if (!result) {
......@@ -78,7 +78,7 @@ void CryptoAlgorithmHMAC::importKey(const CryptoAlgorithmParameters& parameters,
}
const CryptoKeyDataOctetSequence& keyDataOctetSequence = toCryptoKeyDataOctetSequence(keyData);
const CryptoAlgorithmHmacParams& hmacParameters = static_cast<const CryptoAlgorithmHmacParams&>(parameters);
const CryptoAlgorithmHmacParams& hmacParameters = toCryptoAlgorithmHmacParams(parameters);
RefPtr<CryptoKeyHMAC> result = CryptoKeyHMAC::create(keyDataOctetSequence.octetSequence(), hmacParameters.hash, extractable, usage);
promise->fulfill(result.release());
......
......@@ -58,7 +58,7 @@ CryptoAlgorithmIdentifier CryptoAlgorithmRSASSA_PKCS1_v1_5::identifier() const
void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(const CryptoAlgorithmParameters& parameters, const CryptoKeyData& keyData, bool extractable, CryptoKeyUsage usage, std::unique_ptr<PromiseWrapper> promise, ExceptionCode&)
{
const CryptoAlgorithmRsaSsaKeyParams& rsaSSAParameters = static_cast<const CryptoAlgorithmRsaSsaKeyParams&>(parameters);
const CryptoAlgorithmRsaSsaKeyParams& rsaSSAParameters = toCryptoAlgorithmRsaSsaKeyParams(parameters);
const CryptoKeyDataRSAComponents& rsaComponents = toCryptoKeyDataRSAComponents(keyData);
RefPtr<CryptoKeyRSA> result = CryptoKeyRSA::create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5, rsaComponents, extractable, usage);
......@@ -75,7 +75,7 @@ void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(const CryptoAlgorithmParameters
void CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsage usages, std::unique_ptr<PromiseWrapper> promise, ExceptionCode&)
{
const CryptoAlgorithmRsaKeyGenParams& rsaParameters = static_cast<const CryptoAlgorithmRsaKeyGenParams&>(parameters);
const CryptoAlgorithmRsaKeyGenParams& rsaParameters = toCryptoAlgorithmRsaKeyGenParams(parameters);
CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5, rsaParameters.modulusLength, rsaParameters.publicExponent, extractable, usages, std::move(promise));
}
......
......@@ -61,17 +61,7 @@ inline bool isCryptoKeyAES(const CryptoKey& key)
return key.keyClass() == CryptoKeyClass::AES;
}
inline const CryptoKeyAES& toCryptoKeyAES(const CryptoKey& key)
{
ASSERT_WITH_SECURITY_IMPLICATION(isCryptoKeyAES(key));
return static_cast<const CryptoKeyAES&>(key);
}
inline CryptoKeyAES& toCryptoKeyAES(CryptoKey& key)
{
ASSERT_WITH_SECURITY_IMPLICATION(isCryptoKeyAES(key));
return static_cast<CryptoKeyAES&>(key);
}
CRYPTO_KEY_TYPE_CASTS(CryptoKeyAES)
} // namespace WebCore
......
......@@ -49,12 +49,13 @@ private:
Vector<char> m_keyData;
};
inline const CryptoKeyDataOctetSequence& toCryptoKeyDataOctetSequence(const CryptoKeyData& data)
inline bool isCryptoKeyDataOctetSequence(const CryptoKeyData& data)
{
ASSERT(data.format() == CryptoKeyData::Format::OctetSequence);
return static_cast<const CryptoKeyDataOctetSequence&>(data);
return data.format() == CryptoKeyData::Format::OctetSequence;
}
CRYPTO_KEY_DATA_CASTS(CryptoKeyDataOctetSequence)
} // namespace WebCore
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -95,12 +95,13 @@ private:
Vector<PrimeInfo> m_otherPrimeInfos; // When three or more primes have been used, the number of array elements is be the number of primes used minus two.
};
inline const CryptoKeyDataRSAComponents& toCryptoKeyDataRSAComponents(const CryptoKeyData& data)
inline bool isCryptoKeyDataRSAComponents(const CryptoKeyData& data)
{
ASSERT(data.format() == CryptoKeyData::Format::RSAComponents);
return static_cast<const CryptoKeyDataRSAComponents&>(data);
return data.format() == CryptoKeyData::Format::RSAComponents;
}
CRYPTO_KEY_DATA_CASTS(CryptoKeyDataRSAComponents)
} // namespace WebCore
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -62,17 +62,7 @@ inline bool isCryptoKeyHMAC(const CryptoKey& key)
return key.keyClass() == CryptoKeyClass::HMAC;
}
inline const CryptoKeyHMAC& toCryptoKeyHMAC(const CryptoKey& key)
{
ASSERT_WITH_SECURITY_IMPLICATION(isCryptoKeyHMAC(key));
return static_cast<const CryptoKeyHMAC&>(key);
}
inline CryptoKeyHMAC& toCryptoKeyHMAC(CryptoKey& key)
{
ASSERT_WITH_SECURITY_IMPLICATION(isCryptoKeyHMAC(key));
return static_cast<CryptoKeyHMAC&>(key);
}
CRYPTO_KEY_TYPE_CASTS(CryptoKeyHMAC)
} // namespace WebCore
......
......@@ -74,17 +74,7 @@ inline bool isCryptoKeyRSA(const CryptoKey& key)
return key.keyClass() == CryptoKeyClass::RSA;
}
inline const CryptoKeyRSA& toCryptoKeyRSA(const CryptoKey& key)
{
ASSERT_WITH_SECURITY_IMPLICATION(isCryptoKeyRSA(key));
return static_cast<const CryptoKeyRSA&>(key);
}
inline CryptoKeyRSA& asCryptoKeyRSA(CryptoKey& key)
{
ASSERT_WITH_SECURITY_IMPLICATION(isCryptoKeyRSA(key));
return static_cast<CryptoKeyRSA&>(key);
}
CRYPTO_KEY_TYPE_CASTS(CryptoKeyRSA)
} // namespace WebCore
......
......@@ -35,7 +35,7 @@
namespace WebCore {
class CryptoKeySerializationRaw FINAL : public CryptoKeySerialization {
WTF_MAKE_NONCOPYABLE(CryptoKeySerializationRaw);
WTF_MAKE_NONCOPYABLE(CryptoKeySerializationRaw);
public:
static std::unique_ptr<CryptoKeySerializationRaw> create(const CryptoOperationData& data)
{
......@@ -44,6 +44,9 @@ public:
virtual ~CryptoKeySerializationRaw();
private:
CryptoKeySerializationRaw(const CryptoOperationData&);
virtual bool reconcileAlgorithm(std::unique_ptr<CryptoAlgorithm>&, std::unique_ptr<CryptoAlgorithmParameters>&) const OVERRIDE;
virtual void reconcileUsages(CryptoKeyUsage&) const OVERRIDE;
......@@ -51,9 +54,6 @@ public:
virtual std::unique_ptr<CryptoKeyData> keyData() const OVERRIDE;
private:
CryptoKeySerializationRaw(const CryptoOperationData&);
Vector<char> m_data;
};
......
......@@ -91,7 +91,7 @@ static void transformAES_CBC(CCOperation operation, const CryptoAlgorithmAesCbcP
void CryptoAlgorithmAES_CBC::encrypt(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const Vector<CryptoOperationData>& data, std::unique_ptr<PromiseWrapper> promise, ExceptionCode& ec)
{
const CryptoAlgorithmAesCbcParams& aesCBCParameters = static_cast<const CryptoAlgorithmAesCbcParams&>(parameters);
const CryptoAlgorithmAesCbcParams& aesCBCParameters = toCryptoAlgorithmAesCbcParams(parameters);
if (!isCryptoKeyAES(key)) {
ec = NOT_SUPPORTED_ERR;
......@@ -104,7 +104,7 @@ void CryptoAlgorithmAES_CBC::encrypt(const CryptoAlgorithmParameters& parameters
void CryptoAlgorithmAES_CBC::decrypt(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const Vector<CryptoOperationData>& data, std::unique_ptr<PromiseWrapper> promise, ExceptionCode& ec)
{
const CryptoAlgorithmAesCbcParams& aesCBCParameters = static_cast<const CryptoAlgorithmAesCbcParams&>(parameters);
const CryptoAlgorithmAesCbcParams& aesCBCParameters = toCryptoAlgorithmAesCbcParams(parameters);
if (!isCryptoKeyAES(key)) {
ec = NOT_SUPPORTED_ERR;
......
......@@ -94,7 +94,7 @@ static Vector<unsigned char> calculateSignature(CCHmacAlgorithm algorithm, const
void CryptoAlgorithmHMAC::sign(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const Vector<CryptoOperationData>& data, std::unique_ptr<PromiseWrapper> promise, ExceptionCode& ec)
{
const CryptoAlgorithmHmacParams& hmacParameters = static_cast<const CryptoAlgorithmHmacParams&>(parameters);
const CryptoAlgorithmHmacParams& hmacParameters = toCryptoAlgorithmHmacParams(parameters);
if (!isCryptoKeyHMAC(key)) {
ec = NOT_SUPPORTED_ERR;
......@@ -115,7 +115,7 @@ void CryptoAlgorithmHMAC::sign(const CryptoAlgorithmParameters& parameters, cons
void CryptoAlgorithmHMAC::verify(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& expectedSignature, const Vector<CryptoOperationData>& data, std::unique_ptr<PromiseWrapper> promise, ExceptionCode& ec)
{
const CryptoAlgorithmHmacParams& hmacParameters = static_cast<const CryptoAlgorithmHmacParams&>(parameters);
const CryptoAlgorithmHmacParams& hmacParameters = toCryptoAlgorithmHmacParams(parameters);
if (!isCryptoKeyHMAC(key)) {
ec = NOT_SUPPORTED_ERR;
......
......@@ -37,8 +37,12 @@ class CryptoAlgorithmAesCbcParams FINAL : public CryptoAlgorithmParameters {
public:
// The initialization vector. MUST be 16 bytes.
FixedArray<char, 16> iv;
virtual Class parametersClass() const OVERRIDE { return Class::AesCbcParams; }
};
CRYPTO_ALGORITHM_PARAMETERS_CASTS(AesCbcParams)
}
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -36,8 +36,12 @@ class CryptoAlgorithmAesKeyGenParams FINAL : public CryptoAlgorithmParameters {
public:
// The length, in bits, of the key.
unsigned length;
virtual Class parametersClass() const OVERRIDE { return Class::AesKeyGenParams; }
};
CRYPTO_ALGORITHM_PARAMETERS_CASTS(AesKeyGenParams)
}
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -47,8 +47,12 @@ public:
// which is the size of the associated hash function's block size.
bool hasLength;
unsigned length;
virtual Class parametersClass() const OVERRIDE { return Class::HmacKeyParams; }
};
CRYPTO_ALGORITHM_PARAMETERS_CASTS(HmacKeyParams)
}
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -37,8 +37,12 @@ class CryptoAlgorithmHmacParams FINAL : public CryptoAlgorithmParameters {
public:
// The inner hash function to use.
CryptoAlgorithmIdentifier hash;
virtual Class parametersClass() const OVERRIDE { return Class::HmacParams; }
};
CRYPTO_ALGORITHM_PARAMETERS_CASTS(HmacParams)
}
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -38,8 +38,12 @@ public:
unsigned modulusLength;
// The RSA public exponent, encoded as BigInteger.
Vector<char> publicExponent;
virtual Class parametersClass() const OVERRIDE { return Class::RsaKeyGenParams; }
};
CRYPTO_ALGORITHM_PARAMETERS_CASTS(RsaKeyGenParams)
}
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -46,8 +46,12 @@ public:
// The hash algorithm to use.
bool hasHash;
CryptoAlgorithmIdentifier hash;
virtual Class parametersClass() const OVERRIDE { return Class::RsaSsaKeyParams; }
};
CRYPTO_ALGORITHM_PARAMETERS_CASTS(RsaSsaKeyParams)
}
#endif // ENABLE(SUBTLE_CRYPTO)
......
......@@ -37,8 +37,12 @@ class CryptoAlgorithmRsaSsaParams FINAL : public CryptoAlgorithmParameters {
public:
// The hash algorithm to use.
CryptoAlgorithmIdentifier hash;
virtual Class parametersClass() const OVERRIDE { return Class::RsaSsaParams; }
};
CRYPTO_ALGORITHM_PARAMETERS_CASTS(RsaSsaParams)
}
#endif // ENABLE(SUBTLE_CRYPTO)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment