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

Unified Diff: components/webcrypto/algorithms/hkdf.cc

Issue 2544533002: Have all overloads of webcrypto::AlgorithmImplementation::DeserializeKeyForClone check the params t… (Closed)
Patch Set: add a test for a case similar to the one the fuzzer found Created 4 years 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
Index: components/webcrypto/algorithms/hkdf.cc
diff --git a/components/webcrypto/algorithms/hkdf.cc b/components/webcrypto/algorithms/hkdf.cc
index 90a204513d3131012fe32ce6a5a801c99a370051..bb86f69449d269b9fd54701d45bfb499dc75e8a5 100644
--- a/components/webcrypto/algorithms/hkdf.cc
+++ b/components/webcrypto/algorithms/hkdf.cc
@@ -105,6 +105,9 @@ class HkdfImplementation : public AlgorithmImplementation {
blink::WebCryptoKeyUsageMask usages,
const CryptoData& key_data,
blink::WebCryptoKey* key) const override {
+ if (algorithm.paramsType() != blink::WebCryptoKeyAlgorithmParamsTypeNone)
+ return Status::ErrorUnexpected();
+
eroman 2016/11/30 19:15:50 Can you also add a test for: type == WebCryptoK
// NOTE: Unlike ImportKeyRaw(), this does not enforce extractable==false.
// This is intentional. Although keys cannot currently be created with
// extractable==true, earlier implementations permitted this, so

Powered by Google App Engine
This is Rietveld 408576698