Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: net/cert/test_root_certs_win.cc

Issue 1987793002: Remove Windows Vista/XP specific code from net/cert and net/ssl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/cert/cert_verify_proc_unittest.cc ('k') | net/ssl/ssl_platform_key_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test_root_certs.h" 5 #include "net/cert/test_root_certs.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/win/win_util.h" 11 #include "base/win/win_util.h"
12 #include "base/win/windows_version.h"
13 #include "net/cert/x509_certificate.h" 12 #include "net/cert/x509_certificate.h"
14 13
15 namespace net { 14 namespace net {
16 15
17 namespace { 16 namespace {
18 17
19 // Provides a CertDllOpenStoreProv callback provider function, to be called 18 // Provides a CertDllOpenStoreProv callback provider function, to be called
20 // by CertOpenStore when the CERT_STORE_PROV_SYSTEM_W store is opened. See 19 // by CertOpenStore when the CERT_STORE_PROV_SYSTEM_W store is opened. See
21 // http://msdn.microsoft.com/en-us/library/aa376043(VS.85).aspx. 20 // http://msdn.microsoft.com/en-us/library/aa376043(VS.85).aspx.
22 BOOL WINAPI InterceptedOpenStoreW(LPCSTR store_provider, 21 BOOL WINAPI InterceptedOpenStoreW(LPCSTR store_provider,
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 165 }
167 166
168 bool TestRootCerts::IsEmpty() const { 167 bool TestRootCerts::IsEmpty() const {
169 return empty_; 168 return empty_;
170 } 169 }
171 170
172 HCERTCHAINENGINE TestRootCerts::GetChainEngine() const { 171 HCERTCHAINENGINE TestRootCerts::GetChainEngine() const {
173 if (IsEmpty()) 172 if (IsEmpty())
174 return NULL; // Default chain engine will suffice. 173 return NULL; // Default chain engine will suffice.
175 174
176 // Windows versions before 7 don't accept the struct size for later versions. 175 // Windows versions before 8 don't accept the struct size for later versions.
177 // We report the size of the old struct since we don't need the new members. 176 // We report the size of the old struct since we don't need the new members.
178 static const DWORD kSizeofCertChainEngineConfig = 177 static const DWORD kSizeofCertChainEngineConfig =
179 SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER( 178 SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER(CERT_CHAIN_ENGINE_CONFIG,
180 CERT_CHAIN_ENGINE_CONFIG, CycleDetectionModulus); 179 hExclusiveTrustedPeople);
181 180
182 // Each HCERTCHAINENGINE caches both the configured system stores and 181 // Each HCERTCHAINENGINE caches both the configured system stores and
183 // information about each chain that has been built. In order to ensure 182 // information about each chain that has been built. In order to ensure
184 // that changes to |temporary_roots_| are properly propagated and that the 183 // that changes to |temporary_roots_| are properly propagated and that the
185 // various caches are flushed, when at least one certificate is added, 184 // various caches are flushed, when at least one certificate is added,
186 // return a new chain engine for every call. Each chain engine creation 185 // return a new chain engine for every call. Each chain engine creation
187 // should re-open the root store, ensuring the most recent changes are 186 // should re-open the root store, ensuring the most recent changes are
188 // visible. 187 // visible.
189 CERT_CHAIN_ENGINE_CONFIG engine_config = { 188 CERT_CHAIN_ENGINE_CONFIG engine_config = {
190 kSizeofCertChainEngineConfig 189 kSizeofCertChainEngineConfig
(...skipping 13 matching lines...) Expand all
204 203
205 void TestRootCerts::Init() { 204 void TestRootCerts::Init() {
206 empty_ = true; 205 empty_ = true;
207 temporary_roots_ = CertOpenStore( 206 temporary_roots_ = CertOpenStore(
208 CERT_STORE_PROV_MEMORY, 0, NULL, 207 CERT_STORE_PROV_MEMORY, 0, NULL,
209 CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, NULL); 208 CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, NULL);
210 DCHECK(temporary_roots_); 209 DCHECK(temporary_roots_);
211 } 210 }
212 211
213 } // namespace net 212 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/cert_verify_proc_unittest.cc ('k') | net/ssl/ssl_platform_key_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698