Index: Source/platform/exported/WebCryptoKeyAlgorithm.cpp |
diff --git a/Source/platform/exported/WebCryptoKeyAlgorithm.cpp b/Source/platform/exported/WebCryptoKeyAlgorithm.cpp |
index bef587d0d25dbd6e796cacba6688ed7e2bc256b6..0c226e6135b3b7f27b38d07060fb6251847632cf 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, nullptr); |
+} |
+ |
bool WebCryptoKeyAlgorithm::isNull() const |
{ |
return m_private.isNull(); |
@@ -148,7 +155,8 @@ void WebCryptoKeyAlgorithm::writeToDictionary(WebCryptoKeyAlgorithmDictionary* d |
{ |
ASSERT(!isNull()); |
dict->setString("name", WebCryptoAlgorithm::lookupAlgorithmInfo(id())->name); |
- m_private->params.get()->writeToDictionary(dict); |
+ if (m_private->params.get()) |
+ m_private->params.get()->writeToDictionary(dict); |
} |
void WebCryptoKeyAlgorithm::assign(const WebCryptoKeyAlgorithm& other) |