Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1433)

Unified Diff: Source/platform/exported/WebCryptoKeyAlgorithm.cpp

Issue 789733009: Implement HKDF for WebCrypto (blink-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: move ASSERT(), add break Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/exported/WebCryptoAlgorithm.cpp ('k') | public/platform/WebCryptoAlgorithm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/exported/WebCryptoKeyAlgorithm.cpp
diff --git a/Source/platform/exported/WebCryptoKeyAlgorithm.cpp b/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
index bef587d0d25dbd6e796cacba6688ed7e2bc256b6..d2d259855bc95076ae9304cc9eeac70e8d12a893 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::createWithoutParams(WebCryptoAlgorithmId id)
+{
+ if (!WebCryptoAlgorithm::isKdf(id))
+ return WebCryptoKeyAlgorithm();
+ return WebCryptoKeyAlgorithm(id, 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)
« no previous file with comments | « Source/platform/exported/WebCryptoAlgorithm.cpp ('k') | public/platform/WebCryptoAlgorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698