diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-04 00:50:35 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-04 00:50:35 +0000 |
commit | 673266c4267a4bee5c8e63934d65f9accd534f42 (patch) | |
tree | 4bff6f58cddc30a7e7206fd37d9ed50f3b43bd21 /crypto/hmac_openssl.cc | |
parent | 62e832e0f78a47a64d2a9e19757d89f144e04993 (diff) | |
download | chromium_src-673266c4267a4bee5c8e63934d65f9accd534f42.zip chromium_src-673266c4267a4bee5c8e63934d65f9accd534f42.tar.gz chromium_src-673266c4267a4bee5c8e63934d65f9accd534f42.tar.bz2 |
Use size_t as the type of the key_length and digest_length arguments
of HMAC::Init() and HMAC::Sign().
R=agl@chromium.org,bradnelson@chromium.org,thakis@chromium.org
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11419270
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/hmac_openssl.cc')
-rw-r--r-- | crypto/hmac_openssl.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/hmac_openssl.cc b/crypto/hmac_openssl.cc index 3ea1c6a..f7010c8 100644 --- a/crypto/hmac_openssl.cc +++ b/crypto/hmac_openssl.cc @@ -26,7 +26,7 @@ HMAC::HMAC(HashAlgorithm hash_alg) DCHECK(hash_alg_ == SHA1 || hash_alg_ == SHA256); } -bool HMAC::Init(const unsigned char* key, int key_length) { +bool HMAC::Init(const unsigned char* key, size_t key_length) { // Init must not be called more than once on the same HMAC object. DCHECK(plat_->key.empty()); @@ -42,8 +42,7 @@ HMAC::~HMAC() { bool HMAC::Sign(const base::StringPiece& data, unsigned char* digest, - int digest_length) const { - DCHECK_GE(digest_length, 0); + size_t digest_length) const { DCHECK(!plat_->key.empty()); // Init must be called before Sign. ScopedOpenSSLSafeSizeBuffer<EVP_MAX_MD_SIZE> result(digest, digest_length); |