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

Unified Diff: net/base/cert_verify_proc.cc

Issue 10545166: Support SHA-256 in public key pins for HTTPS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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/base/cert_verify_proc.cc
===================================================================
--- net/base/cert_verify_proc.cc (revision 142157)
+++ net/base/cert_verify_proc.cc (working copy)
@@ -217,8 +217,9 @@
}
// static
+// NOTE: This implementation assumes and enforces that the hashes are SHA1.
bool CertVerifyProc::IsPublicKeyBlacklisted(
- const std::vector<SHA1Fingerprint>& public_key_hashes) {
+ const std::vector<Fingerprint>& public_key_hashes) {
static const unsigned kNumHashes = 8;
static const uint8 kHashes[kNumHashes][base::kSHA1Length] = {
// Subject: CN=DigiNotar Root CA
@@ -259,10 +260,12 @@
};
for (unsigned i = 0; i < kNumHashes; i++) {
- for (std::vector<SHA1Fingerprint>::const_iterator
+ for (std::vector<Fingerprint>::const_iterator
j = public_key_hashes.begin(); j != public_key_hashes.end(); ++j) {
- if (memcmp(j->data, kHashes[i], base::kSHA1Length) == 0)
+ if (j->tag == FINGERPRINT_SHA1 &&
+ memcmp(j->data(), kHashes[i], base::kSHA1Length) == 0) {
return true;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698