Chromium Code Reviews| Index: components/webcrypto/algorithms/hmac.cc |
| diff --git a/components/webcrypto/algorithms/hmac.cc b/components/webcrypto/algorithms/hmac.cc |
| index 05caa7c6c5cdc64549fad770770bc022329137fd..f3f3e2a8833ed5a2177e21e7f12791f76c217c26 100644 |
| --- a/components/webcrypto/algorithms/hmac.cc |
| +++ b/components/webcrypto/algorithms/hmac.cc |
| @@ -291,6 +291,9 @@ class HmacImplementation : public AlgorithmImplementation { |
| blink::WebCryptoKeyUsageMask usages, |
| const CryptoData& key_data, |
| blink::WebCryptoKey* key) const override { |
| + if (algorithm.paramsType() != blink::WebCryptoKeyAlgorithmParamsTypeHmac) |
| + return Status::ErrorUnexpected(); |
| + |
|
eroman
2016/11/30 19:15:50
Can you also add a test for:
type == WebCryptoK
|
| return CreateWebCryptoSecretKey(key_data, algorithm, extractable, usages, |
| key); |
| } |