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

Unified Diff: content/child/webcrypto/shared_crypto.cc

Issue 193393002: [webcrypto] Change HMAC key generation length from bytes to bits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 | « no previous file | content/child/webcrypto/shared_crypto_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/shared_crypto.cc
diff --git a/content/child/webcrypto/shared_crypto.cc b/content/child/webcrypto/shared_crypto.cc
index 580754ae47966343874aee1766ea68b8d2672d52..bbcd9a674a191ab1eab7d7f2448166001381bff2 100644
--- a/content/child/webcrypto/shared_crypto.cc
+++ b/content/child/webcrypto/shared_crypto.cc
@@ -315,15 +315,10 @@ Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoHmacKeyGenParams* params =
algorithm.hmacKeyGenParams();
DCHECK(params);
-#if defined(WEBCRYPTO_HMAC_BITS)
if (params->hasLengthBits()) {
if (params->optionalLengthBits() % 8)
return Status::ErrorGenerateKeyLength();
keylen_bytes = params->optionalLengthBits() / 8;
-#else
- if (params->hasLengthBytes()) {
- keylen_bytes = params->optionalLengthBytes();
-#endif
} else {
keylen_bytes = ShaBlockSizeBytes(params->hash().id());
if (keylen_bytes == 0)
« no previous file with comments | « no previous file | content/child/webcrypto/shared_crypto_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698