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

Side by Side Diff: net/ssl/client_cert_store_impl_win.cc

Issue 18121007: *WIP* Store NSS slots per profile. Move keygen to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cert manager basics working Created 7 years, 2 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 | Annotate | Revision Log
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/ssl/client_cert_store_impl.h" 5 #include "net/ssl/client_cert_store_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #define SECURITY_WIN32 // Needs to be defined before including security.h 10 #define SECURITY_WIN32 // Needs to be defined before including security.h
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 std::sort(selected_certs->begin(), selected_certs->end(), 139 std::sort(selected_certs->begin(), selected_certs->end(),
140 x509_util::ClientCertSorter()); 140 x509_util::ClientCertSorter());
141 return true; 141 return true;
142 } 142 }
143 143
144 } // namespace 144 } // namespace
145 145
146 bool ClientCertStoreImpl::GetClientCerts(const SSLCertRequestInfo& request, 146 bool ClientCertStoreImpl::GetClientCerts(const SSLCertRequestInfo& request,
147 CertificateList* selected_certs) { 147 CertificateList* selected_certs,
148 const base::Closure& callback) {
148 // Client certificates of the user are in the "MY" system certificate store. 149 // Client certificates of the user are in the "MY" system certificate store.
149 HCERTSTORE my_cert_store = CertOpenSystemStore(NULL, L"MY"); 150 HCERTSTORE my_cert_store = CertOpenSystemStore(NULL, L"MY");
150 if (!my_cert_store) { 151 if (!my_cert_store) {
151 PLOG(ERROR) << "Could not open the \"MY\" system certificate store: "; 152 PLOG(ERROR) << "Could not open the \"MY\" system certificate store: ";
152 return false; 153 callback.Run();
154 return;
153 } 155 }
154 156
155 bool rv = GetClientCertsImpl(my_cert_store, request, selected_certs); 157 GetClientCertsImpl(my_cert_store, request, selected_certs);
156 if (!CertCloseStore(my_cert_store, CERT_CLOSE_STORE_CHECK_FLAG)) { 158 if (!CertCloseStore(my_cert_store, CERT_CLOSE_STORE_CHECK_FLAG))
157 PLOG(ERROR) << "Could not close the \"MY\" system certificate store: "; 159 PLOG(ERROR) << "Could not close the \"MY\" system certificate store: ";
158 return false; 160 callback.Run();
159 }
160 return rv;
161 } 161 }
162 162
163 bool ClientCertStoreImpl::SelectClientCertsForTesting( 163 bool ClientCertStoreImpl::SelectClientCertsForTesting(
164 const CertificateList& input_certs, 164 const CertificateList& input_certs,
165 const SSLCertRequestInfo& request, 165 const SSLCertRequestInfo& request,
166 CertificateList* selected_certs) { 166 CertificateList* selected_certs) {
167 typedef crypto::ScopedCAPIHandle< 167 typedef crypto::ScopedCAPIHandle<
168 HCERTSTORE, 168 HCERTSTORE,
169 crypto::CAPIDestroyerWithFlags<HCERTSTORE, 169 crypto::CAPIDestroyerWithFlags<HCERTSTORE,
170 CertCloseStore, 0> > ScopedHCERTSTORE; 170 CertCloseStore, 0> > ScopedHCERTSTORE;
(...skipping 25 matching lines...) Expand all
196 // copy). 196 // copy).
197 if (!CertFreeCertificateContext(cert)) 197 if (!CertFreeCertificateContext(cert))
198 return false; 198 return false;
199 } 199 }
200 200
201 bool rv = GetClientCertsImpl(test_store.get(), request, selected_certs); 201 bool rv = GetClientCertsImpl(test_store.get(), request, selected_certs);
202 return rv; 202 return rv;
203 } 203 }
204 204
205 } // namespace net 205 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/client_cert_store_impl_nss.cc ('k') | net/third_party/mozilla_security_manager/nsNSSCertificateDB.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698