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

Unified Diff: content/child/webcrypto/openssl/aes_key_openssl.cc

Issue 512023002: Refactor the interface for generating keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Run git-cl format 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/openssl/aes_key_openssl.h ('k') | content/child/webcrypto/openssl/hmac_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/openssl/aes_key_openssl.cc
diff --git a/content/child/webcrypto/openssl/aes_key_openssl.cc b/content/child/webcrypto/openssl/aes_key_openssl.cc
index 9e97d96d0f29a45b0f5ef5fad67d10c7db5c84ff..738b87bc670f6cb903304a219ade8294c52fa978 100644
--- a/content/child/webcrypto/openssl/aes_key_openssl.cc
+++ b/content/child/webcrypto/openssl/aes_key_openssl.cc
@@ -30,19 +30,16 @@ AesAlgorithm::AesAlgorithm(const std::string& jwk_suffix)
jwk_suffix_(jwk_suffix) {
}
-Status AesAlgorithm::VerifyKeyUsagesBeforeGenerateKey(
- blink::WebCryptoKeyUsageMask usage_mask) const {
- return CheckKeyCreationUsages(all_key_usages_, usage_mask);
-}
+Status AesAlgorithm::GenerateKey(const blink::WebCryptoAlgorithm& algorithm,
+ bool extractable,
+ blink::WebCryptoKeyUsageMask usage_mask,
+ GenerateKeyResult* result) const {
+ Status status = CheckKeyCreationUsages(all_key_usages_, usage_mask);
+ if (status.IsError())
+ return status;
-Status AesAlgorithm::GenerateSecretKey(
- const blink::WebCryptoAlgorithm& algorithm,
- bool extractable,
- blink::WebCryptoKeyUsageMask usage_mask,
- blink::WebCryptoKey* key) const {
unsigned int keylen_bits;
- Status status =
- GetAesKeyGenLengthInBits(algorithm.aesKeyGenParams(), &keylen_bits);
+ status = GetAesKeyGenLengthInBits(algorithm.aesKeyGenParams(), &keylen_bits);
if (status.IsError())
return status;
@@ -51,7 +48,7 @@ Status AesAlgorithm::GenerateSecretKey(
extractable,
usage_mask,
keylen_bits / 8,
- key);
+ result);
}
Status AesAlgorithm::VerifyKeyUsagesBeforeImportKey(
« no previous file with comments | « content/child/webcrypto/openssl/aes_key_openssl.h ('k') | content/child/webcrypto/openssl/hmac_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698