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

Unified Diff: content/child/webcrypto/webcrypto_util.cc

Issue 196513002: [webcrypto] Implement structured clone of keys (chromium-side). (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
Index: content/child/webcrypto/webcrypto_util.cc
diff --git a/content/child/webcrypto/webcrypto_util.cc b/content/child/webcrypto/webcrypto_util.cc
index 3058d0abe3bea972436c3770dadbed2f31b6a39d..e2839c49fa3b42c634f0be8465410ce64fd3e611 100644
--- a/content/child/webcrypto/webcrypto_util.cc
+++ b/content/child/webcrypto/webcrypto_util.cc
@@ -256,20 +256,26 @@ blink::WebCryptoAlgorithm CreateHmacImportAlgorithm(
new blink::WebCryptoHmacImportParams(CreateAlgorithm(hash_id)));
}
-blink::WebCryptoAlgorithm CreateRsaSsaImportAlgorithm(
+blink::WebCryptoAlgorithm CreateRsaHashedImportAlgorithm(
+ blink::WebCryptoAlgorithmId id,
blink::WebCryptoAlgorithmId hash_id) {
DCHECK(IsHashAlgorithm(hash_id));
Ryan Sleevi 2014/03/12 22:56:55 Does Blink also make this check? If so, I agree t
eroman 2014/03/12 23:10:10 Yes. For the codepath I added that calls CreateRsa
+ DCHECK(id == blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5 ||
+ id == blink::WebCryptoAlgorithmIdRsaOaep);
return blink::WebCryptoAlgorithm::adoptParamsAndCreate(
- blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5,
- new blink::WebCryptoRsaHashedImportParams(CreateAlgorithm(hash_id)));
+ id, new blink::WebCryptoRsaHashedImportParams(CreateAlgorithm(hash_id)));
+}
+
+blink::WebCryptoAlgorithm CreateRsaSsaImportAlgorithm(
+ blink::WebCryptoAlgorithmId hash_id) {
+ return CreateRsaHashedImportAlgorithm(
+ blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5, hash_id);
}
blink::WebCryptoAlgorithm CreateRsaOaepImportAlgorithm(
blink::WebCryptoAlgorithmId hash_id) {
- DCHECK(IsHashAlgorithm(hash_id));
- return blink::WebCryptoAlgorithm::adoptParamsAndCreate(
- blink::WebCryptoAlgorithmIdRsaOaep,
- new blink::WebCryptoRsaHashedImportParams(CreateAlgorithm(hash_id)));
+ return CreateRsaHashedImportAlgorithm(blink::WebCryptoAlgorithmIdRsaOaep,
+ hash_id);
}
unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id) {
« content/child/webcrypto/shared_crypto.cc ('K') | « content/child/webcrypto/webcrypto_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698