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

Unified Diff: content/child/webcrypto/nss/aes_gcm_nss.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/nss/aes_gcm_nss.cc
diff --git a/content/child/webcrypto/nss/aes_gcm_nss.cc b/content/child/webcrypto/nss/aes_gcm_nss.cc
index 5dfbb08328e711e05252524077fcaa4275ed8f56..7c5bac69bf788bb382126787d5afdc4cb2b9fb60 100644
--- a/content/child/webcrypto/nss/aes_gcm_nss.cc
+++ b/content/child/webcrypto/nss/aes_gcm_nss.cc
@@ -153,13 +153,18 @@ class AesGcmImplementation : public AesAlgorithm {
return AesAlgorithm::VerifyKeyUsagesBeforeImportKey(format, usage_mask);
}
- virtual Status VerifyKeyUsagesBeforeGenerateKey(
- blink::WebCryptoKeyUsageMask usage_mask) const OVERRIDE {
+ virtual Status GenerateKey(const blink::WebCryptoAlgorithm& algorithm,
+ bool extractable,
+ blink::WebCryptoKeyUsageMask usage_mask,
+ blink::WebCryptoKey* unused_public_key,
+ blink::WebCryptoKey* key) const OVERRIDE {
// Prevent generating AES-GCM keys if it is unavailable.
Status status = NssSupportsAesGcm();
if (status.IsError())
return status;
- return AesAlgorithm::VerifyKeyUsagesBeforeGenerateKey(usage_mask);
+
+ return AesAlgorithm::GenerateKey(
+ algorithm, extractable, usage_mask, unused_public_key, key);
}
virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,

Powered by Google App Engine
This is Rietveld 408576698