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

Side by Side Diff: net/base/cert_verify_proc.cc

Issue 10855168: Rename X509Certificate::VerifyFlags to CertVerifier::VerifyFlags (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile fix Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/cert_verify_proc.h" 5 #include "net/base/cert_verify_proc.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/sha1.h" 8 #include "base/sha1.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "net/base/cert_status_flags.h" 10 #include "net/base/cert_status_flags.h"
11 #include "net/base/cert_verifier.h"
11 #include "net/base/cert_verify_result.h" 12 #include "net/base/cert_verify_result.h"
12 #include "net/base/crl_set.h" 13 #include "net/base/crl_set.h"
13 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
14 #include "net/base/x509_certificate.h" 15 #include "net/base/x509_certificate.h"
15 16
16 #if defined(USE_NSS) 17 #if defined(USE_NSS)
17 #include "net/base/cert_verify_proc_nss.h" 18 #include "net/base/cert_verify_proc_nss.h"
18 #elif defined(USE_OPENSSL) 19 #elif defined(USE_OPENSSL)
19 #include "net/base/cert_verify_proc_openssl.h" 20 #include "net/base/cert_verify_proc_openssl.h"
20 #elif defined(OS_MACOSX) 21 #elif defined(OS_MACOSX)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return ERR_CERT_REVOKED; 79 return ERR_CERT_REVOKED;
79 } 80 }
80 81
81 // If EV verification was requested and no CRLSet is present, or if the 82 // If EV verification was requested and no CRLSet is present, or if the
82 // CRLSet has expired, then enable online revocation checks. If the online 83 // CRLSet has expired, then enable online revocation checks. If the online
83 // check fails, EV status won't be shown. 84 // check fails, EV status won't be shown.
84 // 85 //
85 // A possible optimisation is to only enable online revocation checking in 86 // A possible optimisation is to only enable online revocation checking in
86 // the event that the leaf certificate appears to include a EV policy ID. 87 // the event that the leaf certificate appears to include a EV policy ID.
87 // However, it's expected that having a current CRLSet will be very common. 88 // However, it's expected that having a current CRLSet will be very common.
88 if ((flags & X509Certificate::VERIFY_EV_CERT) && 89 if ((flags & CertVerifier::VERIFY_EV_CERT) &&
89 (!crl_set || crl_set->IsExpired())) { 90 (!crl_set || crl_set->IsExpired())) {
90 flags |= X509Certificate::VERIFY_REV_CHECKING_ENABLED; 91 flags |= CertVerifier::VERIFY_REV_CHECKING_ENABLED;
91 } 92 }
92 93
93 int rv = VerifyInternal(cert, hostname, flags, crl_set, verify_result); 94 int rv = VerifyInternal(cert, hostname, flags, crl_set, verify_result);
94 95
95 // This check is done after VerifyInternal so that VerifyInternal can fill 96 // This check is done after VerifyInternal so that VerifyInternal can fill
96 // in the list of public key hashes. 97 // in the list of public key hashes.
97 if (IsPublicKeyBlacklisted(verify_result->public_key_hashes)) { 98 if (IsPublicKeyBlacklisted(verify_result->public_key_hashes)) {
98 verify_result->cert_status |= CERT_STATUS_REVOKED; 99 verify_result->cert_status |= CERT_STATUS_REVOKED;
99 rv = MapCertStatusToNetError(verify_result->cert_status); 100 rv = MapCertStatusToNetError(verify_result->cert_status);
100 } 101 }
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 j = public_key_hashes.begin(); j != public_key_hashes.end(); ++j) { 269 j = public_key_hashes.begin(); j != public_key_hashes.end(); ++j) {
269 if (memcmp(j->data, kHashes[i], base::kSHA1Length) == 0) 270 if (memcmp(j->data, kHashes[i], base::kSHA1Length) == 0)
270 return true; 271 return true;
271 } 272 }
272 } 273 }
273 274
274 return false; 275 return false;
275 } 276 }
276 277
277 } // namespace net 278 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698