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

Unified Diff: content/child/webcrypto/algorithm_dispatch.cc

Issue 777403004: [WebCrypto] Throw syntaxError if keyUsage is empty in ImportKey (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | content/child/webcrypto/status.h » ('j') | content/child/webcrypto/test/rsa_ssa_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/algorithm_dispatch.cc
diff --git a/content/child/webcrypto/algorithm_dispatch.cc b/content/child/webcrypto/algorithm_dispatch.cc
index 1c9b409ace58e4cf87aa1dfa7014a4e46bb6aec4..cf665a3d269e7ebae715af9921c7b3268be486da 100644
--- a/content/child/webcrypto/algorithm_dispatch.cc
+++ b/content/child/webcrypto/algorithm_dispatch.cc
@@ -129,6 +129,9 @@ Status ImportKey(blink::WebCryptoKeyFormat format,
if (status.IsError())
return status;
+ if (usages == 0)
eroman 2014/12/05 20:45:51 This is not correct. Some key types are allowed
Habib Virji 2014/12/08 15:05:21 Updated. Have found usages only in AES and HMAC.
+ return Status::ErrorImportEmptyKeyUsage();
+
switch (format) {
case blink::WebCryptoKeyFormatRaw:
return impl->ImportKeyRaw(key_data, algorithm, extractable, usages, key);
« no previous file with comments | « no previous file | content/child/webcrypto/status.h » ('j') | content/child/webcrypto/test/rsa_ssa_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698