Chromium Code Reviews| Index: Source/platform/exported/WebCryptoKeyAlgorithm.cpp |
| diff --git a/Source/platform/exported/WebCryptoKeyAlgorithm.cpp b/Source/platform/exported/WebCryptoKeyAlgorithm.cpp |
| index bef587d0d25dbd6e796cacba6688ed7e2bc256b6..f675939b84b0a5970acb52f8f125090d97fc1d25 100644 |
| --- a/Source/platform/exported/WebCryptoKeyAlgorithm.cpp |
| +++ b/Source/platform/exported/WebCryptoKeyAlgorithm.cpp |
| @@ -93,6 +93,13 @@ WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createEc(WebCryptoAlgorithmId id, W |
| return WebCryptoKeyAlgorithm(id, adoptPtr(new WebCryptoEcKeyAlgorithmParams(namedCurve))); |
| } |
| +WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createKdf(WebCryptoAlgorithmId kdf) |
| +{ |
| + if (!WebCryptoAlgorithm::isKdf(kdf)) |
| + return WebCryptoKeyAlgorithm(); |
| + return WebCryptoKeyAlgorithm(kdf, adoptPtr(new WebCryptoKdfKeyAlgorithmParams())); |
| +} |
| + |
| bool WebCryptoKeyAlgorithm::isNull() const |
| { |
| return m_private.isNull(); |
| @@ -144,11 +151,20 @@ WebCryptoEcKeyAlgorithmParams* WebCryptoKeyAlgorithm::ecParams() const |
| return 0; |
| } |
| +WebCryptoKdfKeyAlgorithmParams* WebCryptoKeyAlgorithm::kdfParams() const |
| +{ |
| + ASSERT(!isNull()); |
| + if (paramsType() == WebCryptoKeyAlgorithmParamsTypeKdf) |
| + return static_cast<WebCryptoKdfKeyAlgorithmParams*>(m_private->params.get()); |
| + return 0; |
| +} |
| + |
| void WebCryptoKeyAlgorithm::writeToDictionary(WebCryptoKeyAlgorithmDictionary* dict) const |
| { |
| ASSERT(!isNull()); |
| dict->setString("name", WebCryptoAlgorithm::lookupAlgorithmInfo(id())->name); |
| - m_private->params.get()->writeToDictionary(dict); |
| + if (m_private->params.get()) |
|
eroman
2015/01/07 00:40:31
This change seems like it is sufficient, rather th
nharper
2015/01/08 00:58:39
The introduction of KdfKeyParams was to make somet
|
| + m_private->params.get()->writeToDictionary(dict); |
| } |
| void WebCryptoKeyAlgorithm::assign(const WebCryptoKeyAlgorithm& other) |