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_win.h" | 5 #include "net/cert/cert_verify_proc_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 | 734 |
735 ScopedPCCERT_CHAIN_CONTEXT scoped_chain_context(chain_context); | 735 ScopedPCCERT_CHAIN_CONTEXT scoped_chain_context(chain_context); |
736 | 736 |
737 verify_result->cert_status |= MapCertChainErrorStatusToCertStatus( | 737 verify_result->cert_status |= MapCertChainErrorStatusToCertStatus( |
738 chain_context->TrustStatus.dwErrorStatus); | 738 chain_context->TrustStatus.dwErrorStatus); |
739 | 739 |
740 // Flag certificates that have a Subject common name with a NULL character. | 740 // Flag certificates that have a Subject common name with a NULL character. |
741 if (CertSubjectCommonNameHasNull(cert_handle)) | 741 if (CertSubjectCommonNameHasNull(cert_handle)) |
742 verify_result->cert_status |= CERT_STATUS_INVALID; | 742 verify_result->cert_status |= CERT_STATUS_INVALID; |
743 | 743 |
744 std::wstring wstr_hostname = base::ASCIIToWide(hostname); | 744 base::string16 hostname16 = base::ASCIIToUTF16(hostname); |
745 | 745 |
746 SSL_EXTRA_CERT_CHAIN_POLICY_PARA extra_policy_para; | 746 SSL_EXTRA_CERT_CHAIN_POLICY_PARA extra_policy_para; |
747 memset(&extra_policy_para, 0, sizeof(extra_policy_para)); | 747 memset(&extra_policy_para, 0, sizeof(extra_policy_para)); |
748 extra_policy_para.cbSize = sizeof(extra_policy_para); | 748 extra_policy_para.cbSize = sizeof(extra_policy_para); |
749 extra_policy_para.dwAuthType = AUTHTYPE_SERVER; | 749 extra_policy_para.dwAuthType = AUTHTYPE_SERVER; |
750 // Certificate name validation happens separately, later, using an internal | 750 // Certificate name validation happens separately, later, using an internal |
751 // routine that has better support for RFC 6125 name matching. | 751 // routine that has better support for RFC 6125 name matching. |
752 extra_policy_para.fdwChecks = | 752 extra_policy_para.fdwChecks = |
753 0x00001000; // SECURITY_FLAG_IGNORE_CERT_CN_INVALID | 753 0x00001000; // SECURITY_FLAG_IGNORE_CERT_CN_INVALID |
754 extra_policy_para.pwszServerName = | 754 extra_policy_para.pwszServerName = |
755 const_cast<wchar_t*>(wstr_hostname.c_str()); | 755 const_cast<base::char16*>(hostname16.c_str()); |
756 | 756 |
757 CERT_CHAIN_POLICY_PARA policy_para; | 757 CERT_CHAIN_POLICY_PARA policy_para; |
758 memset(&policy_para, 0, sizeof(policy_para)); | 758 memset(&policy_para, 0, sizeof(policy_para)); |
759 policy_para.cbSize = sizeof(policy_para); | 759 policy_para.cbSize = sizeof(policy_para); |
760 policy_para.dwFlags = 0; | 760 policy_para.dwFlags = 0; |
761 policy_para.pvExtraPolicyPara = &extra_policy_para; | 761 policy_para.pvExtraPolicyPara = &extra_policy_para; |
762 | 762 |
763 CERT_CHAIN_POLICY_STATUS policy_status; | 763 CERT_CHAIN_POLICY_STATUS policy_status; |
764 memset(&policy_status, 0, sizeof(policy_status)); | 764 memset(&policy_status, 0, sizeof(policy_status)); |
765 policy_status.cbSize = sizeof(policy_status); | 765 policy_status.cbSize = sizeof(policy_status); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 return MapCertStatusToNetError(verify_result->cert_status); | 803 return MapCertStatusToNetError(verify_result->cert_status); |
804 | 804 |
805 if (ev_policy_oid && | 805 if (ev_policy_oid && |
806 CheckEV(chain_context, rev_checking_enabled, ev_policy_oid)) { | 806 CheckEV(chain_context, rev_checking_enabled, ev_policy_oid)) { |
807 verify_result->cert_status |= CERT_STATUS_IS_EV; | 807 verify_result->cert_status |= CERT_STATUS_IS_EV; |
808 } | 808 } |
809 return OK; | 809 return OK; |
810 } | 810 } |
811 | 811 |
812 } // namespace net | 812 } // namespace net |
OLD | NEW |