Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Unified Diff: components/webcrypto/algorithms/sha.cc

Issue 1908753002: Roll src/third_party/boringssl/src 0fe4d8bef..f01fb5dc0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix webcrypto Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/sha.cc
diff --git a/components/webcrypto/algorithms/sha.cc b/components/webcrypto/algorithms/sha.cc
index 4c4b47ba18bec94977a7cbd638d866f8ad2fccd9..a210fb146f5304486aeef613dfa26e401acdbfed 100644
--- a/components/webcrypto/algorithms/sha.cc
+++ b/components/webcrypto/algorithms/sha.cc
@@ -56,7 +56,7 @@ class DigestorImpl : public blink::WebCryptoDigestor {
}
Status FinishWithVectorAndStatus(std::vector<uint8_t>* result) {
- const int hash_expected_size = EVP_MD_CTX_size(digest_context_.get());
+ const size_t hash_expected_size = EVP_MD_CTX_size(digest_context_.get());
result->resize(hash_expected_size);
unsigned int hash_buffer_size; // ignored
return FinishInternal(result->data(), &hash_buffer_size);
@@ -87,13 +87,13 @@ class DigestorImpl : public blink::WebCryptoDigestor {
if (!error.IsSuccess())
return error;
- const int hash_expected_size = EVP_MD_CTX_size(digest_context_.get());
- if (hash_expected_size <= 0)
+ const size_t hash_expected_size = EVP_MD_CTX_size(digest_context_.get());
+ if (hash_expected_size == 0)
return Status::ErrorUnexpected();
- DCHECK_LE(hash_expected_size, EVP_MAX_MD_SIZE);
+ DCHECK_LE(hash_expected_size, static_cast<unsigned>(EVP_MAX_MD_SIZE));
davidben 2016/04/21 00:17:09 This is kind of depressing. :-/ EVP_MAX_MD_SIZE is
if (!EVP_DigestFinal_ex(digest_context_.get(), result, result_size) ||
- static_cast<int>(*result_size) != hash_expected_size)
+ *result_size != hash_expected_size)
return Status::OperationError();
return Status::Success();
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698