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

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

Issue 2544533002: Have all overloads of webcrypto::AlgorithmImplementation::DeserializeKeyForClone check the params t… (Closed)
Patch Set: additional checks, per eroman 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 | « components/webcrypto/algorithms/hmac.cc ('k') | components/webcrypto/algorithms/rsa.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/pbkdf2.cc
diff --git a/components/webcrypto/algorithms/pbkdf2.cc b/components/webcrypto/algorithms/pbkdf2.cc
index 5e62bc567fc4f90e7d8eca9c7b5e04c9e76ae564..53e65ce07481a4d5a876f44cd093339d183c9af4 100644
--- a/components/webcrypto/algorithms/pbkdf2.cc
+++ b/components/webcrypto/algorithms/pbkdf2.cc
@@ -110,6 +110,10 @@ class Pbkdf2Implementation : public AlgorithmImplementation {
blink::WebCryptoKeyUsageMask usages,
const CryptoData& key_data,
blink::WebCryptoKey* key) const override {
+ if (algorithm.paramsType() != blink::WebCryptoKeyAlgorithmParamsTypeNone ||
+ type != blink::WebCryptoKeyTypeSecret)
+ return Status::ErrorUnexpected();
+
// 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
« no previous file with comments | « components/webcrypto/algorithms/hmac.cc ('k') | components/webcrypto/algorithms/rsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698