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

Unified Diff: content/child/webcrypto/nss/aes_key_nss.cc

Issue 670773003: Cleanup: rename usage_mask --> usages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 | « content/child/webcrypto/nss/aes_key_nss.h ('k') | content/child/webcrypto/nss/hmac_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/nss/aes_key_nss.cc
diff --git a/content/child/webcrypto/nss/aes_key_nss.cc b/content/child/webcrypto/nss/aes_key_nss.cc
index dda4d6bd89b8739f226dfb0784c947e240edc509..2bd0c57e3965ef9499838f6be1b8a08d8b64a761 100644
--- a/content/child/webcrypto/nss/aes_key_nss.cc
+++ b/content/child/webcrypto/nss/aes_key_nss.cc
@@ -40,9 +40,9 @@ AesAlgorithm::AesAlgorithm(CK_MECHANISM_TYPE import_mechanism,
Status AesAlgorithm::GenerateKey(const blink::WebCryptoAlgorithm& algorithm,
bool extractable,
- blink::WebCryptoKeyUsageMask usage_mask,
+ blink::WebCryptoKeyUsageMask usages,
GenerateKeyResult* result) const {
- Status status = CheckKeyCreationUsages(all_key_usages_, usage_mask);
+ Status status = CheckKeyCreationUsages(all_key_usages_, usages);
if (status.IsError())
return status;
@@ -54,7 +54,7 @@ Status AesAlgorithm::GenerateKey(const blink::WebCryptoAlgorithm& algorithm,
return GenerateSecretKeyNss(
blink::WebCryptoKeyAlgorithm::createAes(algorithm.id(), keylen_bits),
extractable,
- usage_mask,
+ usages,
keylen_bits / 8,
CKM_AES_KEY_GEN,
result);
@@ -62,11 +62,11 @@ Status AesAlgorithm::GenerateKey(const blink::WebCryptoAlgorithm& algorithm,
Status AesAlgorithm::VerifyKeyUsagesBeforeImportKey(
blink::WebCryptoKeyFormat format,
- blink::WebCryptoKeyUsageMask usage_mask) const {
+ blink::WebCryptoKeyUsageMask usages) const {
switch (format) {
case blink::WebCryptoKeyFormatRaw:
case blink::WebCryptoKeyFormatJwk:
- return CheckKeyCreationUsages(all_key_usages_, usage_mask);
+ return CheckKeyCreationUsages(all_key_usages_, usages);
default:
return Status::ErrorUnsupportedImportKeyFormat();
}
@@ -74,7 +74,7 @@ Status AesAlgorithm::VerifyKeyUsagesBeforeImportKey(
Status AesAlgorithm::ImportKeyRaw(const CryptoData& key_data,
const blink::WebCryptoAlgorithm& algorithm,
bool extractable,
- blink::WebCryptoKeyUsageMask usage_mask,
+ blink::WebCryptoKeyUsageMask usages,
blink::WebCryptoKey* key) const {
const unsigned int keylen_bytes = key_data.byte_length();
Status status = VerifyAesKeyLengthForImport(keylen_bytes);
@@ -88,7 +88,7 @@ Status AesAlgorithm::ImportKeyRaw(const CryptoData& key_data,
key_data,
blink::WebCryptoKeyAlgorithm::createAes(algorithm.id(), keylen_bits),
extractable,
- usage_mask,
+ usages,
import_mechanism_,
import_flags_,
key);
@@ -97,16 +97,16 @@ Status AesAlgorithm::ImportKeyRaw(const CryptoData& key_data,
Status AesAlgorithm::ImportKeyJwk(const CryptoData& key_data,
const blink::WebCryptoAlgorithm& algorithm,
bool extractable,
- blink::WebCryptoKeyUsageMask usage_mask,
+ blink::WebCryptoKeyUsageMask usages,
blink::WebCryptoKey* key) const {
std::vector<uint8_t> raw_data;
Status status = ReadAesSecretKeyJwk(
- key_data, jwk_suffix_, extractable, usage_mask, &raw_data);
+ key_data, jwk_suffix_, extractable, usages, &raw_data);
if (status.IsError())
return status;
return ImportKeyRaw(
- CryptoData(raw_data), algorithm, extractable, usage_mask, key);
+ CryptoData(raw_data), algorithm, extractable, usages, key);
}
Status AesAlgorithm::ExportKeyRaw(const blink::WebCryptoKey& key,
« no previous file with comments | « content/child/webcrypto/nss/aes_key_nss.h ('k') | content/child/webcrypto/nss/hmac_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698