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

Unified Diff: public/platform/WebCryptoKeyAlgorithmParams.h

Issue 204013006: [webcrypto] Add length parameter to HmacKeyAlgorithm. (blink) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « Source/modules/crypto/HmacKeyAlgorithm.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebCryptoKeyAlgorithmParams.h
diff --git a/public/platform/WebCryptoKeyAlgorithmParams.h b/public/platform/WebCryptoKeyAlgorithmParams.h
index a90fcbecf43e1c1ce61c2cb5f32d32292a99e634..0e96d563dd8bc20169b3bd044390093ea283555b 100644
--- a/public/platform/WebCryptoKeyAlgorithmParams.h
+++ b/public/platform/WebCryptoKeyAlgorithmParams.h
@@ -35,6 +35,9 @@
#include "WebCryptoAlgorithm.h"
#include "WebVector.h"
+// FIXME: Delete this once the chromium side has picked up the API change.
+#define WEBCRYPTO_HMAC_KEY_HAS_LENGTH 1
+
namespace blink {
enum WebCryptoKeyAlgorithmParamsType {
@@ -77,8 +80,9 @@ private:
class WebCryptoHmacKeyAlgorithmParams : public WebCryptoKeyAlgorithmParams {
public:
- explicit WebCryptoHmacKeyAlgorithmParams(const WebCryptoAlgorithm& hash)
+ WebCryptoHmacKeyAlgorithmParams(const WebCryptoAlgorithm& hash, unsigned lengthBits)
: m_hash(hash)
+ , m_lengthBits(lengthBits)
{
}
@@ -87,6 +91,11 @@ public:
return m_hash;
}
+ unsigned lengthBits() const
+ {
+ return m_lengthBits;
+ }
+
virtual WebCryptoKeyAlgorithmParamsType type() const
{
return WebCryptoKeyAlgorithmParamsTypeHmac;
@@ -94,6 +103,7 @@ public:
private:
WebCryptoAlgorithm m_hash;
+ unsigned m_lengthBits;
};
class WebCryptoRsaKeyAlgorithmParams : public WebCryptoKeyAlgorithmParams {
« no previous file with comments | « Source/modules/crypto/HmacKeyAlgorithm.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698