Chromium Code Reviews| Index: content/child/webcrypto/webcrypto_util.cc |
| diff --git a/content/child/webcrypto/webcrypto_util.cc b/content/child/webcrypto/webcrypto_util.cc |
| index 6dad83fcae7dae6c9cb0bd1ecd7b50139d56c670..aa5d611e0fcea607e6b43376f59e21237fa33331 100644 |
| --- a/content/child/webcrypto/webcrypto_util.cc |
| +++ b/content/child/webcrypto/webcrypto_util.cc |
| @@ -229,7 +229,12 @@ Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes) { |
| } |
| Status CheckKeyCreationUsages(blink::WebCryptoKeyUsageMask all_possible_usages, |
| - blink::WebCryptoKeyUsageMask actual_usages) { |
| + blink::WebCryptoKeyUsageMask actual_usages, |
| + bool check_usage) { |
|
eroman
2014/12/09 21:04:46
This is poorly named -- the entire purpose of this
Habib Virji
2014/12/15 18:48:56
Done.
|
| + // In case import key calls this function, it checks for empty usage |
|
eroman
2014/12/09 21:04:46
This comment is unnecessary (will apply to both im
Habib Virji
2014/12/15 18:48:56
Removed
|
| + if (check_usage && actual_usages == 0) |
| + return Status::ErrorImportKeyEmptyUsages(); |
| + |
| if (!ContainsKeyUsages(all_possible_usages, actual_usages)) |
| return Status::ErrorCreateKeyBadUsages(); |
| return Status::Success(); |