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

Unified Diff: content/child/webcrypto/platform_crypto_nss.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 | « no previous file | content/child/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/platform_crypto_nss.cc
diff --git a/content/child/webcrypto/platform_crypto_nss.cc b/content/child/webcrypto/platform_crypto_nss.cc
index 5192cf4f7989c353bd866030ef72029b2bbae10f..a9387e7486cf87ce1ea09ba13b3e7534964edc74 100644
--- a/content/child/webcrypto/platform_crypto_nss.cc
+++ b/content/child/webcrypto/platform_crypto_nss.cc
@@ -414,22 +414,20 @@ bool CreatePublicKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm,
switch (algorithm.paramsType()) {
case blink::WebCryptoAlgorithmParamsTypeRsaHashedImportParams:
case blink::WebCryptoAlgorithmParamsTypeRsaHashedKeyGenParams:
- *key_algorithm = blink::WebCryptoKeyAlgorithm::adoptParamsAndCreate(
+ *key_algorithm = blink::WebCryptoKeyAlgorithm::createRsaHashed(
algorithm.id(),
- new blink::WebCryptoRsaHashedKeyAlgorithmParams(
- modulus_length_bits,
- public_exponent.bytes(),
- public_exponent.byte_length(),
- GetInnerHashAlgorithm(algorithm)));
+ modulus_length_bits,
+ public_exponent.bytes(),
+ public_exponent.byte_length(),
+ GetInnerHashAlgorithm(algorithm).id());
return true;
case blink::WebCryptoAlgorithmParamsTypeRsaKeyGenParams:
case blink::WebCryptoAlgorithmParamsTypeNone:
- *key_algorithm = blink::WebCryptoKeyAlgorithm::adoptParamsAndCreate(
+ *key_algorithm = blink::WebCryptoKeyAlgorithm::createRsa(
algorithm.id(),
- new blink::WebCryptoRsaKeyAlgorithmParams(
- modulus_length_bits,
- public_exponent.bytes(),
- public_exponent.byte_length()));
+ modulus_length_bits,
+ public_exponent.bytes(),
+ public_exponent.byte_length());
return true;
default:
return false;
« no previous file with comments | « no previous file | content/child/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698