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

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: Created 6 years, 4 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
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..0ae6680da8d471d074dde4a0449fc1b51ec2b494 100644
--- a/content/child/webcrypto/openssl/aes_key_openssl.cc
+++ b/content/child/webcrypto/openssl/aes_key_openssl.cc
@@ -30,19 +30,17 @@ 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,
+ blink::WebCryptoKey*,
+ blink::WebCryptoKey* key) 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;

Powered by Google App Engine
This is Rietveld 408576698