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

Unified Diff: net/base/x509_certificate.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 | « net/base/transport_security_state.cc ('k') | net/base/x509_certificate_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate.cc
===================================================================
--- net/base/x509_certificate.cc (revision 102606)
+++ net/base/x509_certificate.cc (working copy)
@@ -187,7 +187,7 @@
// CompareSHA1Hashes is a helper function for using bsearch() with an array of
// SHA1 hashes.
int CompareSHA1Hashes(const void* a, const void* b) {
- return memcmp(a, b, base::SHA1_LENGTH);
+ return memcmp(a, b, base::kSHA1Length);
}
// Utility to split |src| on the first occurrence of |c|, if any. |right| will
@@ -959,7 +959,7 @@
bool X509Certificate::IsPublicKeyBlacklisted(
const std::vector<SHA1Fingerprint>& public_key_hashes) {
static const unsigned kNumHashes = 5;
- static const uint8 kHashes[kNumHashes][base::SHA1_LENGTH] = {
+ static const uint8 kHashes[kNumHashes][base::kSHA1Length] = {
// Subject: CN=DigiNotar Root CA
// Issuer: CN=Entrust.net x2 and self-signed
{0x41, 0x0f, 0x36, 0x36, 0x32, 0x58, 0xf3, 0x0b, 0x34, 0x7d,
@@ -985,7 +985,7 @@
for (unsigned i = 0; i < kNumHashes; i++) {
for (std::vector<SHA1Fingerprint>::const_iterator
j = public_key_hashes.begin(); j != public_key_hashes.end(); ++j) {
- if (memcmp(j->data, kHashes[i], base::SHA1_LENGTH) == 0)
+ if (memcmp(j->data, kHashes[i], base::kSHA1Length) == 0)
return true;
}
}
@@ -997,9 +997,9 @@
bool X509Certificate::IsSHA1HashInSortedArray(const SHA1Fingerprint& hash,
const uint8* array,
size_t array_byte_len) {
- DCHECK_EQ(0u, array_byte_len % base::SHA1_LENGTH);
- const unsigned arraylen = array_byte_len / base::SHA1_LENGTH;
- return NULL != bsearch(hash.data, array, arraylen, base::SHA1_LENGTH,
+ DCHECK_EQ(0u, array_byte_len % base::kSHA1Length);
+ const size_t arraylen = array_byte_len / base::kSHA1Length;
+ return NULL != bsearch(hash.data, array, arraylen, base::kSHA1Length,
CompareSHA1Hashes);
}
« no previous file with comments | « net/base/transport_security_state.cc ('k') | net/base/x509_certificate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698