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

Unified Diff: content/renderer/webcrypto/webcrypto_impl.cc

Issue 24656002: [webcrypto] Add decrypt() for AES-CBC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reword "non-block-aligned" to "not a multiple of block size" 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
« no previous file with comments | « content/renderer/webcrypto/webcrypto_impl.h ('k') | content/renderer/webcrypto/webcrypto_impl_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webcrypto/webcrypto_impl.cc
diff --git a/content/renderer/webcrypto/webcrypto_impl.cc b/content/renderer/webcrypto/webcrypto_impl.cc
index 32c0433597e706172482cd8ff56acb9cc4a68739..6eeb3daf5a0cb07de9dc19128ed3e2913338054b 100644
--- a/content/renderer/webcrypto/webcrypto_impl.cc
+++ b/content/renderer/webcrypto/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)) {
+ result.completeWithError();
+ } else {
+ result.completeWithBuffer(buffer);
+ }
+}
+
void WebCryptoImpl::digest(
const WebKit::WebCryptoAlgorithm& algorithm,
const unsigned char* data,
« no previous file with comments | « content/renderer/webcrypto/webcrypto_impl.h ('k') | content/renderer/webcrypto/webcrypto_impl_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698