OLD | NEW |
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_nss.h" | 5 #include "net/cert/cert_verify_proc_nss.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include <cert.h> | 10 #include <cert.h> |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 CertVerifyResult* verify_result) { | 756 CertVerifyResult* verify_result) { |
757 #if defined(OS_IOS) | 757 #if defined(OS_IOS) |
758 // For iOS, the entire chain must be loaded into NSS's in-memory certificate | 758 // For iOS, the entire chain must be loaded into NSS's in-memory certificate |
759 // store. | 759 // store. |
760 x509_util_ios::NSSCertChain scoped_chain(cert); | 760 x509_util_ios::NSSCertChain scoped_chain(cert); |
761 CERTCertificate* cert_handle = scoped_chain.cert_handle(); | 761 CERTCertificate* cert_handle = scoped_chain.cert_handle(); |
762 #else | 762 #else |
763 CERTCertificate* cert_handle = cert->os_cert_handle(); | 763 CERTCertificate* cert_handle = cert->os_cert_handle(); |
764 #endif // defined(OS_IOS) | 764 #endif // defined(OS_IOS) |
765 | 765 |
766 // Make sure that the hostname matches with the common name of the cert. | 766 if (!cert->VerifyNameMatch(hostname, |
767 if (!cert->VerifyNameMatch(hostname)) | 767 &verify_result->common_name_fallback_used)) { |
768 verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID; | 768 verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID; |
| 769 } |
769 | 770 |
770 // Make sure that the cert is valid now. | 771 // Make sure that the cert is valid now. |
771 SECCertTimeValidity validity = CERT_CheckCertValidTimes( | 772 SECCertTimeValidity validity = CERT_CheckCertValidTimes( |
772 cert_handle, PR_Now(), PR_TRUE); | 773 cert_handle, PR_Now(), PR_TRUE); |
773 if (validity != secCertTimeValid) | 774 if (validity != secCertTimeValid) |
774 verify_result->cert_status |= CERT_STATUS_DATE_INVALID; | 775 verify_result->cert_status |= CERT_STATUS_DATE_INVALID; |
775 | 776 |
776 CERTValOutParam cvout[3]; | 777 CERTValOutParam cvout[3]; |
777 int cvout_index = 0; | 778 int cvout_index = 0; |
778 cvout[cvout_index].type = cert_po_certList; | 779 cvout[cvout_index].type = cert_po_certList; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 if (VerifyEV(cert_handle, flags, crl_set, check_revocation, metadata, | 883 if (VerifyEV(cert_handle, flags, crl_set, check_revocation, metadata, |
883 ev_policy_oid, trust_anchors.get())) { | 884 ev_policy_oid, trust_anchors.get())) { |
884 verify_result->cert_status |= CERT_STATUS_IS_EV; | 885 verify_result->cert_status |= CERT_STATUS_IS_EV; |
885 } | 886 } |
886 } | 887 } |
887 | 888 |
888 return OK; | 889 return OK; |
889 } | 890 } |
890 | 891 |
891 } // namespace net | 892 } // namespace net |
OLD | NEW |