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

Unified Diff: net/socket/dns_cert_provenance_checker.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
Index: net/socket/dns_cert_provenance_checker.cc
===================================================================
--- net/socket/dns_cert_provenance_checker.cc (revision 102606)
+++ net/socket/dns_cert_provenance_checker.cc (working copy)
@@ -21,8 +21,10 @@
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
#include "base/pickle.h"
+#include "base/sha1.h"
#include "base/threading/non_thread_safe.h"
#include "crypto/encryptor.h"
+#include "crypto/sha2.h"
wtc 2011/09/24 01:39:41 Please undo the changes in this file. This file u
#include "crypto/symmetric_key.h"
#include "net/base/completion_callback.h"
#include "net/base/dns_util.h"
@@ -115,18 +117,18 @@
return;
}
- uint8 fingerprint[SHA1_LENGTH];
+ uint8 fingerprint[base::kSHA1Length];
SECStatus rv = HASH_HashBuf(
HASH_AlgSHA1, fingerprint, (uint8*) der_certs_[0].data(),
der_certs_[0].size());
DCHECK_EQ(SECSuccess, rv);
- char fingerprint_hex[SHA1_LENGTH * 2 + 1];
+ char fingerprint_hex[base::kSHA1Length * 2 + 1];
for (unsigned i = 0; i < sizeof(fingerprint); i++) {
static const char hextable[] = "0123456789abcdef";
fingerprint_hex[i*2] = hextable[fingerprint[i] >> 4];
fingerprint_hex[i*2 + 1] = hextable[fingerprint[i] & 15];
}
- fingerprint_hex[SHA1_LENGTH * 2] = 0;
+ fingerprint_hex[base::kSHA1Length * 2] = 0;
static const char kBaseCertName[] = ".certs.googlednstest.com";
domain_.assign(fingerprint_hex);
@@ -294,7 +296,7 @@
// The key and IV are 128-bits and generated from a SHA256 hash of the x
// value.
- char key_data[SHA256_LENGTH];
+ char key_data[crypto::kSHA256Length];
HASH_HashBuf(HASH_AlgSHA256, reinterpret_cast<uint8*>(key_data),
x_data->data, x_data->len);
PK11_FreeSymKey(pms);
« net/base/x509_certificate_unittest.cc ('K') | « net/base/x509_certificate_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698