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

Unified Diff: public/platform/WebCrypto.h

Issue 151673005: Add digestSynchronous WebCrypto method. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated the function's arguments. Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebCrypto.h
diff --git a/public/platform/WebCrypto.h b/public/platform/WebCrypto.h
index 998a2153ec8165ddf0a17896085ff8d2873a2920..1144af383b14fc847fbf4b0e2ae6b45cca570e3e 100644
--- a/public/platform/WebCrypto.h
+++ b/public/platform/WebCrypto.h
@@ -32,6 +32,7 @@
#define WebCrypto_h
#include "WebCommon.h"
+#include "WebCryptoAlgorithm.h"
#include "WebCryptoKey.h"
#include "WebPrivatePtr.h"
@@ -178,6 +179,13 @@ public:
// It is possible that unwrappedKeyAlgorithm.isNull()
virtual void unwrapKey(WebCryptoKeyFormat, const unsigned char* wrappedKey, unsigned wrappedKeySize, const WebCryptoKey&, const WebCryptoAlgorithm& unwrapAlgorithm, const WebCryptoAlgorithm& unwrappedKeyAlgorithm, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); }
+ // This is the one exception to the "Completing the request" guarantees
+ // outlined above. digestSynchronous must provide the result into result
+ // synchronously. It must return |true| on successful calculation of the
+ // digest and |false| otherwise. This is useful for Blink internal crypto
+ // and is not part of the WebCrypto standard.
+ virtual bool digestSynchronous(const WebCryptoAlgorithmId algorithmId, const unsigned char* data, unsigned dataSize, WebArrayBuffer& result) { return false; }
+
protected:
virtual ~WebCrypto() { }
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698