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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // a NULL character. | 184 // a NULL character. |
185 bool CertSubjectCommonNameHasNull(PCCERT_CONTEXT cert) { | 185 bool CertSubjectCommonNameHasNull(PCCERT_CONTEXT cert) { |
186 CRYPT_DECODE_PARA decode_para; | 186 CRYPT_DECODE_PARA decode_para; |
187 decode_para.cbSize = sizeof(decode_para); | 187 decode_para.cbSize = sizeof(decode_para); |
188 decode_para.pfnAlloc = crypto::CryptAlloc; | 188 decode_para.pfnAlloc = crypto::CryptAlloc; |
189 decode_para.pfnFree = crypto::CryptFree; | 189 decode_para.pfnFree = crypto::CryptFree; |
190 CERT_NAME_INFO* name_info = NULL; | 190 CERT_NAME_INFO* name_info = NULL; |
191 DWORD name_info_size = 0; | 191 DWORD name_info_size = 0; |
192 BOOL rv; | 192 BOOL rv; |
193 rv = CryptDecodeObjectEx(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, | 193 rv = CryptDecodeObjectEx(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, |
194 X509_NAME, | 194 WINCRYPT_X509_NAME, |
195 cert->pCertInfo->Subject.pbData, | 195 cert->pCertInfo->Subject.pbData, |
196 cert->pCertInfo->Subject.cbData, | 196 cert->pCertInfo->Subject.cbData, |
197 CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, | 197 CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, |
198 &decode_para, | 198 &decode_para, |
199 &name_info, | 199 &name_info, |
200 &name_info_size); | 200 &name_info_size); |
201 if (rv) { | 201 if (rv) { |
202 scoped_ptr<CERT_NAME_INFO, base::FreeDeleter> scoped_name_info(name_info); | 202 scoped_ptr<CERT_NAME_INFO, base::FreeDeleter> scoped_name_info(name_info); |
203 | 203 |
204 // The Subject field may have multiple common names. According to the | 204 // The Subject field may have multiple common names. According to the |
(...skipping 598 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 |