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) { |