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/webcrypto_util.cc

Issue 210583003: [webcrypto] Refactor to use WebCryptoKeyAlgorithm create* functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/platform_crypto_nss.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/webcrypto_util.cc
diff --git a/content/child/webcrypto/webcrypto_util.cc b/content/child/webcrypto/webcrypto_util.cc
index 294c4b2264c0cd3aaa40284ea87cf0b9bd977d36..d7326f990794a96d14d1712b89a6afeb3249e0eb 100644
--- a/content/child/webcrypto/webcrypto_util.cc
+++ b/content/child/webcrypto/webcrypto_util.cc
@@ -205,18 +205,16 @@ bool CreateSecretKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm,
return false;
if (keylen_bytes > UINT_MAX / 8)
return false;
- *key_algorithm = blink::WebCryptoKeyAlgorithm::adoptParamsAndCreate(
- algorithm.id(),
- new blink::WebCryptoHmacKeyAlgorithmParams(hash, keylen_bytes * 8));
+ *key_algorithm =
+ blink::WebCryptoKeyAlgorithm::createHmac(hash.id(), keylen_bytes * 8);
return true;
}
case blink::WebCryptoAlgorithmIdAesKw:
case blink::WebCryptoAlgorithmIdAesCbc:
case blink::WebCryptoAlgorithmIdAesCtr:
case blink::WebCryptoAlgorithmIdAesGcm:
- *key_algorithm = blink::WebCryptoKeyAlgorithm::adoptParamsAndCreate(
- algorithm.id(),
- new blink::WebCryptoAesKeyAlgorithmParams(keylen_bytes * 8));
+ *key_algorithm = blink::WebCryptoKeyAlgorithm::createAes(
+ algorithm.id(), keylen_bytes * 8);
return true;
default:
return false;
« no previous file with comments | « content/child/webcrypto/platform_crypto_nss.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698