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

Unified Diff: content/child/webcrypto/nss/sym_key_nss.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/nss/sym_key_nss.h ('k') | content/child/webcrypto/openssl/aes_key_openssl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/nss/sym_key_nss.cc
diff --git a/content/child/webcrypto/nss/sym_key_nss.cc b/content/child/webcrypto/nss/sym_key_nss.cc
index 08eef2836cfbfb5194f74e42c7a2b18a190df5d2..b779e92f6ff941698069146bef65898c41719292 100644
--- a/content/child/webcrypto/nss/sym_key_nss.cc
+++ b/content/child/webcrypto/nss/sym_key_nss.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "content/child/webcrypto/crypto_data.h"
+#include "content/child/webcrypto/generate_key_result.h"
#include "content/child/webcrypto/nss/key_nss.h"
#include "content/child/webcrypto/nss/util_nss.h"
#include "content/child/webcrypto/status.h"
@@ -22,7 +23,7 @@ Status GenerateSecretKeyNss(const blink::WebCryptoKeyAlgorithm& algorithm,
blink::WebCryptoKeyUsageMask usage_mask,
unsigned keylen_bytes,
CK_MECHANISM_TYPE mechanism,
- blink::WebCryptoKey* key) {
+ GenerateKeyResult* result) {
DCHECK_NE(CKM_INVALID_MECHANISM, mechanism);
crypto::ScopedPK11Slot slot(PK11_GetInternalKeySlot());
@@ -45,11 +46,13 @@ Status GenerateSecretKeyNss(const blink::WebCryptoKeyAlgorithm& algorithm,
scoped_ptr<SymKeyNss> handle(new SymKeyNss(
pk11_key.Pass(), CryptoData(key_data->data, key_data->len)));
- *key = blink::WebCryptoKey::create(handle.release(),
- blink::WebCryptoKeyTypeSecret,
- extractable,
- algorithm,
- usage_mask);
+ result->AssignSecretKey(
+ blink::WebCryptoKey::create(handle.release(),
+ blink::WebCryptoKeyTypeSecret,
+ extractable,
+ algorithm,
+ usage_mask));
+
return Status::Success();
}
« no previous file with comments | « content/child/webcrypto/nss/sym_key_nss.h ('k') | content/child/webcrypto/openssl/aes_key_openssl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698