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

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

Issue 2725683002: Move name matching into the shared certificate validator (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | net/cert/cert_verify_proc_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/cert/cert_verify_proc.h" 5 #include "net/cert/cert_verify_proc.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 // TODO(rsleevi): http://crbug.com/142974 - Allow preferences to fully 478 // TODO(rsleevi): http://crbug.com/142974 - Allow preferences to fully
479 // disable revocation checking. 479 // disable revocation checking.
480 if (flags & CertVerifier::VERIFY_EV_CERT) 480 if (flags & CertVerifier::VERIFY_EV_CERT)
481 flags |= CertVerifier::VERIFY_REV_CHECKING_ENABLED_EV_ONLY; 481 flags |= CertVerifier::VERIFY_REV_CHECKING_ENABLED_EV_ONLY;
482 482
483 int rv = VerifyInternal(cert, hostname, ocsp_response, flags, crl_set, 483 int rv = VerifyInternal(cert, hostname, ocsp_response, flags, crl_set,
484 additional_trust_anchors, verify_result); 484 additional_trust_anchors, verify_result);
485 485
486 ComputeSignatureHashAlgorithms(verify_result); 486 ComputeSignatureHashAlgorithms(verify_result);
487 487
488 if (!cert->VerifyNameMatch(hostname,
489 &verify_result->common_name_fallback_used)) {
490 verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID;
491 rv = MapCertStatusToNetError(verify_result->cert_status);
492 }
493
488 UMA_HISTOGRAM_BOOLEAN("Net.CertCommonNameFallback", 494 UMA_HISTOGRAM_BOOLEAN("Net.CertCommonNameFallback",
489 verify_result->common_name_fallback_used); 495 verify_result->common_name_fallback_used);
490 if (!verify_result->is_issued_by_known_root) { 496 if (!verify_result->is_issued_by_known_root) {
491 UMA_HISTOGRAM_BOOLEAN("Net.CertCommonNameFallbackPrivateCA", 497 UMA_HISTOGRAM_BOOLEAN("Net.CertCommonNameFallbackPrivateCA",
492 verify_result->common_name_fallback_used); 498 verify_result->common_name_fallback_used);
493 } 499 }
494 500
495 CheckOCSP(ocsp_response, *verify_result->verified_cert, 501 CheckOCSP(ocsp_response, *verify_result->verified_cert,
496 &verify_result->ocsp_result); 502 &verify_result->ocsp_result);
497 503
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 return true; 839 return true;
834 840
835 return false; 841 return false;
836 } 842 }
837 843
838 // static 844 // static
839 const base::Feature CertVerifyProc::kSHA1LegacyMode{ 845 const base::Feature CertVerifyProc::kSHA1LegacyMode{
840 "SHA1LegacyMode", base::FEATURE_DISABLED_BY_DEFAULT}; 846 "SHA1LegacyMode", base::FEATURE_DISABLED_BY_DEFAULT};
841 847
842 } // namespace net 848 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/cert/cert_verify_proc_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698