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

Unified Diff: base/sha1_win.cc

Issue 7972024: Update SHA1_LENGTH -> kSHA1Length to match previous change to SHA256_LENGTH. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | « base/sha1_unittest.cc ('k') | chrome/app/client_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sha1_win.cc
===================================================================
--- base/sha1_win.cc (revision 102606)
+++ base/sha1_win.cc (working copy)
@@ -19,20 +19,20 @@
if (!CryptAcquireContext(provider.receive(), NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT)) {
LOG(ERROR) << "CryptAcquireContext failed: " << GetLastError();
- return std::string(SHA1_LENGTH, '\0');
+ return std::string(kSHA1Length, '\0');
}
{
ScopedHCRYPTHASH hash;
if (!CryptCreateHash(provider, CALG_SHA1, 0, 0, hash.receive())) {
LOG(ERROR) << "CryptCreateHash failed: " << GetLastError();
- return std::string(SHA1_LENGTH, '\0');
+ return std::string(kSHA1Length, '\0');
}
if (!CryptHashData(hash, reinterpret_cast<CONST BYTE*>(str.data()),
static_cast<DWORD>(str.length()), 0)) {
LOG(ERROR) << "CryptHashData failed: " << GetLastError();
- return std::string(SHA1_LENGTH, '\0');
+ return std::string(kSHA1Length, '\0');
}
DWORD hash_len = 0;
@@ -41,7 +41,7 @@
reinterpret_cast<unsigned char*>(&hash_len),
&buffer_size, 0)) {
LOG(ERROR) << "CryptGetHashParam(HP_HASHSIZE) failed: " << GetLastError();
- return std::string(SHA1_LENGTH, '\0');
+ return std::string(kSHA1Length, '\0');
}
std::string result;
@@ -51,13 +51,13 @@
reinterpret_cast<BYTE*>(WriteInto(&result, hash_len + 1)), &hash_len,
0))) {
LOG(ERROR) << "CryptGetHashParam(HP_HASHVAL) failed: " << GetLastError();
- return std::string(SHA1_LENGTH, '\0');
+ return std::string(kSHA1Length, '\0');
}
- if (hash_len != SHA1_LENGTH) {
+ if (hash_len != kSHA1Length) {
LOG(ERROR) << "Returned hash value is wrong length: " << hash_len
- << " should be " << SHA1_LENGTH;
- return std::string(SHA1_LENGTH, '\0');
+ << " should be " << kSHA1Length;
+ return std::string(kSHA1Length, '\0');
}
return result;
« no previous file with comments | « base/sha1_unittest.cc ('k') | chrome/app/client_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698