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

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: rebase and add header for WebVector 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/webcrypto_util.h ('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 537e551f0363bd39a316405e86ddf1c6822deed4..5e5fc8e4c3d2b7857e438bdb0c32e5af6f59f2f0 100644
--- a/content/child/webcrypto/webcrypto_util.cc
+++ b/content/child/webcrypto/webcrypto_util.cc
@@ -340,20 +340,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));
+ 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) {
« no previous file with comments | « content/child/webcrypto/webcrypto_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698