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

Unified Diff: net/base/x509_certificate.cc

Issue 7792023: Merge 98741 to 782: Mark DigiNotar as untrusted (Closed) Base URL: svn://svn.chromium.org/chrome/branches/782/src
Patch Set: Created 9 years, 4 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/x509_certificate.h ('k') | net/base/x509_certificate_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate.cc
diff --git a/net/base/x509_certificate.cc b/net/base/x509_certificate.cc
index 4934ef3c3aff1348a6323eb769ace33bc7fc1e1e..cc3bc992d93ac8d5dc65ca79196efd5337ef8603 100644
--- a/net/base/x509_certificate.cc
+++ b/net/base/x509_certificate.cc
@@ -591,6 +591,28 @@ bool X509Certificate::IsBlacklisted() const {
}
// static
+bool X509Certificate::IsPublicKeyBlacklisted(
+ const std::vector<SHA1Fingerprint>& public_key_hashes) {
+ static const unsigned kNumHashes = 1;
+ static const uint8 kHashes[kNumHashes][base::SHA1_LENGTH] = {
+ // CN=DigiNotar Root CA
+ {0x41, 0x0f, 0x36, 0x36, 0x32, 0x58, 0xf3, 0x0b, 0x34, 0x7d,
+ 0x12, 0xce, 0x48, 0x63, 0xe4, 0x33, 0x43, 0x78, 0x06, 0xa8},
+ };
+
+ 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)
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+// static
bool X509Certificate::IsSHA1HashInSortedArray(const SHA1Fingerprint& hash,
const uint8* array,
size_t array_byte_len) {
« no previous file with comments | « net/base/x509_certificate.h ('k') | net/base/x509_certificate_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698