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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 return ERR_UNEXPECTED; | 564 return ERR_UNEXPECTED; |
565 | 565 |
566 // Build and validate certificate chain. | 566 // Build and validate certificate chain. |
567 CERT_CHAIN_PARA chain_para; | 567 CERT_CHAIN_PARA chain_para; |
568 memset(&chain_para, 0, sizeof(chain_para)); | 568 memset(&chain_para, 0, sizeof(chain_para)); |
569 chain_para.cbSize = sizeof(chain_para); | 569 chain_para.cbSize = sizeof(chain_para); |
570 // ExtendedKeyUsage. | 570 // ExtendedKeyUsage. |
571 // We still need to request szOID_SERVER_GATED_CRYPTO and szOID_SGC_NETSCAPE | 571 // We still need to request szOID_SERVER_GATED_CRYPTO and szOID_SGC_NETSCAPE |
572 // today because some certificate chains need them. IE also requests these | 572 // today because some certificate chains need them. IE also requests these |
573 // two usages. | 573 // two usages. |
574 static const LPSTR usage[] = { | 574 static const LPCSTR usage[] = { |
575 szOID_PKIX_KP_SERVER_AUTH, | 575 szOID_PKIX_KP_SERVER_AUTH, |
576 szOID_SERVER_GATED_CRYPTO, | 576 szOID_SERVER_GATED_CRYPTO, |
577 szOID_SGC_NETSCAPE | 577 szOID_SGC_NETSCAPE |
578 }; | 578 }; |
579 chain_para.RequestedUsage.dwType = USAGE_MATCH_TYPE_OR; | 579 chain_para.RequestedUsage.dwType = USAGE_MATCH_TYPE_OR; |
580 chain_para.RequestedUsage.Usage.cUsageIdentifier = arraysize(usage); | 580 chain_para.RequestedUsage.Usage.cUsageIdentifier = arraysize(usage); |
581 chain_para.RequestedUsage.Usage.rgpszUsageIdentifier = | 581 chain_para.RequestedUsage.Usage.rgpszUsageIdentifier = |
582 const_cast<LPSTR*>(usage); | 582 const_cast<LPSTR*>(usage); |
583 | 583 |
584 // Get the certificatePolicies extension of the certificate. | 584 // Get the certificatePolicies extension of the certificate. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 return MapCertStatusToNetError(verify_result->cert_status); | 796 return MapCertStatusToNetError(verify_result->cert_status); |
797 | 797 |
798 if (ev_policy_oid && | 798 if (ev_policy_oid && |
799 CheckEV(chain_context, rev_checking_enabled, ev_policy_oid)) { | 799 CheckEV(chain_context, rev_checking_enabled, ev_policy_oid)) { |
800 verify_result->cert_status |= CERT_STATUS_IS_EV; | 800 verify_result->cert_status |= CERT_STATUS_IS_EV; |
801 } | 801 } |
802 return OK; | 802 return OK; |
803 } | 803 } |
804 | 804 |
805 } // namespace net | 805 } // namespace net |
OLD | NEW |