Chromium Code Reviews| Index: content/renderer/webcrypto/shared_crypto.cc |
| diff --git a/content/renderer/webcrypto/shared_crypto.cc b/content/renderer/webcrypto/shared_crypto.cc |
| index b3681c36db6e1e06ac82cec3c44f855982c19afb..ff52493f2cae7fa580aaa8e74281fe837df709c5 100644 |
| --- a/content/renderer/webcrypto/shared_crypto.cc |
| +++ b/content/renderer/webcrypto/shared_crypto.cc |
| @@ -315,8 +315,15 @@ Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm, |
| const blink::WebCryptoHmacKeyGenParams* params = |
| algorithm.hmacKeyGenParams(); |
| DCHECK(params); |
| +#ifdef WEBCRYPTO_HMAC_BITS |
|
Ryan Sleevi
2014/03/06 21:51:37
if defined(...)
eroman
2014/03/06 21:54:18
Done.
|
| + 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) |