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); |