Index: components/webcrypto/algorithms/aes_cbc.cc |
diff --git a/components/webcrypto/algorithms/aes_cbc.cc b/components/webcrypto/algorithms/aes_cbc.cc |
index c9e941aa7ee92f636d0dc84e5e4e8c0853fb35aa..678aa5ac2cefa6a2f162c77f1a5b13144440c220 100644 |
--- a/components/webcrypto/algorithms/aes_cbc.cc |
+++ b/components/webcrypto/algorithms/aes_cbc.cc |
@@ -1,3 +1,4 @@ |
+ |
// Copyright 2014 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -55,7 +56,8 @@ Status AesCbcEncryptDecrypt(EncryptOrDecrypt cipher_operation, |
if (!output_max_len.IsValid()) |
return Status::ErrorDataTooLarge(); |
- const unsigned remainder = output_max_len.ValueOrDie() % AES_BLOCK_SIZE; |
+ const unsigned remainder = |
+ base::ValueOrDieForType<unsigned>(output_max_len % AES_BLOCK_SIZE); |
if (remainder != 0) |
output_max_len += AES_BLOCK_SIZE - remainder; |
if (!output_max_len.IsValid()) |
@@ -71,7 +73,7 @@ Status AesCbcEncryptDecrypt(EncryptOrDecrypt cipher_operation, |
return Status::OperationError(); |
} |
- buffer->resize(output_max_len.ValueOrDie()); |
+ buffer->resize(base::ValueOrDieForType<size_t>(output_max_len)); |
int output_len = 0; |
if (!EVP_CipherUpdate(context.get(), buffer->data(), &output_len, |