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 <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 (flags & CertVerifier::VERIFY_REV_CHECKING_ENABLED); | 942 (flags & CertVerifier::VERIFY_REV_CHECKING_ENABLED); |
943 if (rev_checking_enabled) { | 943 if (rev_checking_enabled) { |
944 verify_result->cert_status |= CERT_STATUS_REV_CHECKING_ENABLED; | 944 verify_result->cert_status |= CERT_STATUS_REV_CHECKING_ENABLED; |
945 } else { | 945 } else { |
946 chain_flags |= CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY; | 946 chain_flags |= CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY; |
947 } | 947 } |
948 | 948 |
949 // By default, use the default HCERTCHAINENGINE (aka HCCE_CURRENT_USER). When | 949 // By default, use the default HCERTCHAINENGINE (aka HCCE_CURRENT_USER). When |
950 // running tests, use a dynamic HCERTCHAINENGINE. All of the status and cache | 950 // running tests, use a dynamic HCERTCHAINENGINE. All of the status and cache |
951 // of verified certificates and chains is tied to the HCERTCHAINENGINE. As | 951 // of verified certificates and chains is tied to the HCERTCHAINENGINE. As |
952 // each invocation may have changed the set of known roots, invalid the cache | 952 // each invocation may have changed the set of known roots, invalidate the |
953 // between runs. | 953 // cache between runs. |
954 // | 954 // |
955 // This is not the most efficient means of doing so; it's possible to mark the | 955 // This is not the most efficient means of doing so; it's possible to mark the |
956 // Root store used by TestRootCerts as changed, via CertControlStore with the | 956 // Root store used by TestRootCerts as changed, via CertControlStore with the |
957 // CERT_STORE_CTRL_NOTIFY_CHANGE / CERT_STORE_CTRL_RESYNC, but that's more | 957 // CERT_STORE_CTRL_NOTIFY_CHANGE / CERT_STORE_CTRL_RESYNC, but that's more |
958 // complexity for what is test-only code. | 958 // complexity for what is test-only code. |
959 ScopedHCERTCHAINENGINE chain_engine(NULL); | 959 ScopedHCERTCHAINENGINE chain_engine(NULL); |
960 if (TestRootCerts::HasInstance()) | 960 if (TestRootCerts::HasInstance()) |
961 chain_engine.reset(TestRootCerts::GetInstance()->GetChainEngine()); | 961 chain_engine.reset(TestRootCerts::GetInstance()->GetChainEngine()); |
962 | 962 |
963 ScopedPCCERT_CONTEXT cert_list(cert->CreateOSCertChainForCert()); | 963 ScopedPCCERT_CONTEXT cert_list(cert->CreateOSCertChainForCert()); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 return MapCertStatusToNetError(verify_result->cert_status); | 1145 return MapCertStatusToNetError(verify_result->cert_status); |
1146 | 1146 |
1147 if (ev_policy_oid && | 1147 if (ev_policy_oid && |
1148 CheckEV(chain_context, rev_checking_enabled, ev_policy_oid)) { | 1148 CheckEV(chain_context, rev_checking_enabled, ev_policy_oid)) { |
1149 verify_result->cert_status |= CERT_STATUS_IS_EV; | 1149 verify_result->cert_status |= CERT_STATUS_IS_EV; |
1150 } | 1150 } |
1151 return OK; | 1151 return OK; |
1152 } | 1152 } |
1153 | 1153 |
1154 } // namespace net | 1154 } // namespace net |
OLD | NEW |