Chromium Code Reviews| Index: components/webcrypto/algorithms/aes.cc |
| diff --git a/components/webcrypto/algorithms/aes.cc b/components/webcrypto/algorithms/aes.cc |
| index f46ea15a119bf502f399bbf4e3e9cc664db962a3..2ba6a042ede5e4cc6ff7174b168bc722eb7eee4a 100644 |
| --- a/components/webcrypto/algorithms/aes.cc |
| +++ b/components/webcrypto/algorithms/aes.cc |
| @@ -199,6 +199,9 @@ Status AesAlgorithm::DeserializeKeyForClone( |
| blink::WebCryptoKeyUsageMask usages, |
| const CryptoData& key_data, |
| blink::WebCryptoKey* key) const { |
| + if (algorithm.paramsType() != blink::WebCryptoKeyAlgorithmParamsTypeAes) |
| + return Status::ErrorUnexpected(); |
| + |
|
eroman
2016/11/30 19:15:50
Can you also add a test for
type == WebCryptoKey
|
| return ImportKeyRaw(key_data, SynthesizeImportAlgorithmForClone(algorithm), |
| extractable, usages, key); |
| } |