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

Unified Diff: chrome/nacl/nacl_validation_query.cc

Issue 11419270: Use size_t as the type of key_length and digest_length arguments of HMAC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove the DCHECK on a digest_length of 0 from hmac_openssl.cc Created 8 years 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 | « chrome/nacl/nacl_validation_query.h ('k') | crypto/hmac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/nacl/nacl_validation_query.cc
===================================================================
--- chrome/nacl/nacl_validation_query.cc (revision 170598)
+++ chrome/nacl/nacl_validation_query.cc (working copy)
@@ -50,12 +50,11 @@
void NaClValidationQuery::AddData(const char* data, size_t length) {
CHECK(state_ == READY);
- CHECK(buffer_length_ >= 0);
- CHECK(buffer_length_ <= (int) sizeof(buffer_));
+ CHECK(buffer_length_ <= sizeof(buffer_));
// Chrome's HMAC class doesn't support incremental signing. Work around
// this by using a (small) temporary buffer to accumulate data.
// Check if there is space in the buffer.
- if (buffer_length_ + kDigestLength > (int) sizeof(buffer_)) {
+ if (buffer_length_ + kDigestLength > sizeof(buffer_)) {
// Hash the buffer to make space.
CompressBuffer();
}
@@ -79,7 +78,7 @@
CHECK(state_ == READY);
// It is suspicious if we have less than a digest's worth of data.
CHECK(buffer_length_ >= kDigestLength);
- CHECK(buffer_length_ <= (int) sizeof(buffer_));
+ CHECK(buffer_length_ <= sizeof(buffer_));
state_ = GET_CALLED;
// Ensure the buffer contains only one digest worth of data.
CompressBuffer();
« no previous file with comments | « chrome/nacl/nacl_validation_query.h ('k') | crypto/hmac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698