| Index: content/renderer/webcrypto/webcrypto_util.cc
|
| diff --git a/content/renderer/webcrypto/webcrypto_util.cc b/content/renderer/webcrypto/webcrypto_util.cc
|
| index b5a318a1be2b9a99721c737520c947a442f7172a..53cd2fafc9429a9c9eecd1e106e3ddbc93956c02 100644
|
| --- a/content/renderer/webcrypto/webcrypto_util.cc
|
| +++ b/content/renderer/webcrypto/webcrypto_util.cc
|
| @@ -73,14 +73,25 @@ bool Base64DecodeUrlSafe(const std::string& input, std::string* output) {
|
|
|
| blink::WebCryptoAlgorithm GetInnerHashAlgorithm(
|
| const blink::WebCryptoAlgorithm& algorithm) {
|
| - if (algorithm.hmacParams())
|
| - return algorithm.hmacParams()->hash();
|
| - if (algorithm.hmacKeyParams())
|
| - return algorithm.hmacKeyParams()->hash();
|
| - if (algorithm.rsaSsaParams())
|
| - return algorithm.rsaSsaParams()->hash();
|
| - if (algorithm.rsaOaepParams())
|
| - return algorithm.rsaOaepParams()->hash();
|
| + DCHECK(!algorithm.isNull());
|
| + switch (algorithm.id()) {
|
| + case blink::WebCryptoAlgorithmIdHmac:
|
| + if (algorithm.hmacParams())
|
| + return algorithm.hmacParams()->hash();
|
| + else if (algorithm.hmacKeyParams())
|
| + return algorithm.hmacKeyParams()->hash();
|
| + break;
|
| + case blink::WebCryptoAlgorithmIdRsaOaep:
|
| + if (algorithm.rsaOaepParams())
|
| + return algorithm.rsaOaepParams()->hash();
|
| + break;
|
| + case blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5:
|
| + if (algorithm.rsaSsaParams())
|
| + return algorithm.rsaSsaParams()->hash();
|
| + break;
|
| + default:
|
| + break;
|
| + }
|
| return blink::WebCryptoAlgorithm::createNull();
|
| }
|
|
|
|
|