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

Unified Diff: components/webcrypto/algorithms/aes.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
« no previous file with comments | « no previous file | components/webcrypto/algorithms/ec.cc » ('j') | components/webcrypto/algorithms/hkdf.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/aes.cc
diff --git a/components/webcrypto/algorithms/aes.cc b/components/webcrypto/algorithms/aes.cc
index f46ea15a119bf502f399bbf4e3e9cc664db962a3..2ba6a042ede5e4cc6ff7174b168bc722eb7eee4a 100644
--- a/components/webcrypto/algorithms/aes.cc
+++ b/components/webcrypto/algorithms/aes.cc
@@ -199,6 +199,9 @@ Status AesAlgorithm::DeserializeKeyForClone(
blink::WebCryptoKeyUsageMask usages,
const CryptoData& key_data,
blink::WebCryptoKey* key) const {
+ if (algorithm.paramsType() != blink::WebCryptoKeyAlgorithmParamsTypeAes)
+ return Status::ErrorUnexpected();
+
eroman 2016/11/30 19:15:50 Can you also add a test for type == WebCryptoKey
return ImportKeyRaw(key_data, SynthesizeImportAlgorithmForClone(algorithm),
extractable, usages, key);
}
« no previous file with comments | « no previous file | components/webcrypto/algorithms/ec.cc » ('j') | components/webcrypto/algorithms/hkdf.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698