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

Unified Diff: content/renderer/webcrypto_impl.cc

Issue 24656002: [webcrypto] Add decrypt() for AES-CBC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/renderer/webcrypto_impl.cc
diff --git a/content/renderer/webcrypto_impl.cc b/content/renderer/webcrypto_impl.cc
index b62eb0931657cdd5905dad6c76fd80519a633afb..b9c68a11672d09386627b05556d3e5aad616dc87 100644
--- a/content/renderer/webcrypto_impl.cc
+++ b/content/renderer/webcrypto_impl.cc
@@ -29,6 +29,20 @@ void WebCryptoImpl::encrypt(
}
}
+void WebCryptoImpl::decrypt(
+ const WebKit::WebCryptoAlgorithm& algorithm,
+ const WebKit::WebCryptoKey& key,
+ const unsigned char* data,
+ unsigned data_size,
+ WebKit::WebCryptoResult result) {
+ WebKit::WebArrayBuffer buffer;
+ if (!DecryptInternal(algorithm, key, data, data_size, &buffer)) {
jamesr 2013/09/25 21:29:05 no {}s for one-line bodies, right?
eroman 2013/09/25 22:11:59 I am matching the style elsewhere in this file. A
+ result.completeWithError();
+ } else {
+ result.completeWithBuffer(buffer);
+ }
+}
+
void WebCryptoImpl::digest(
const WebKit::WebCryptoAlgorithm& algorithm,
const unsigned char* data,

Powered by Google App Engine
This is Rietveld 408576698