| 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/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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 } | 153 } |
| 154 | 154 |
| 155 bool rv = GetClientCertsImpl(my_cert_store, request, selected_certs); | 155 bool rv = GetClientCertsImpl(my_cert_store, request, selected_certs); |
| 156 if (!CertCloseStore(my_cert_store, CERT_CLOSE_STORE_CHECK_FLAG)) { | 156 if (!CertCloseStore(my_cert_store, CERT_CLOSE_STORE_CHECK_FLAG)) { |
| 157 PLOG(ERROR) << "Could not close the \"MY\" system certificate store: "; | 157 PLOG(ERROR) << "Could not close the \"MY\" system certificate store: "; |
| 158 return false; | 158 return false; |
| 159 } | 159 } |
| 160 return rv; | 160 return rv; |
| 161 } | 161 } |
| 162 | 162 |
| 163 bool ClientCertStoreImpl::SelectClientCerts(const CertificateList& input_certs, | 163 bool ClientCertStoreImpl::SelectClientCertsForTesting( |
| 164 const SSLCertRequestInfo& request, | 164 const CertificateList& input_certs, |
| 165 CertificateList* selected_certs) { | 165 const SSLCertRequestInfo& request, |
| 166 CertificateList* selected_certs) { |
| 166 typedef crypto::ScopedCAPIHandle< | 167 typedef crypto::ScopedCAPIHandle< |
| 167 HCERTSTORE, | 168 HCERTSTORE, |
| 168 crypto::CAPIDestroyerWithFlags<HCERTSTORE, | 169 crypto::CAPIDestroyerWithFlags<HCERTSTORE, |
| 169 CertCloseStore, 0> > ScopedHCERTSTORE; | 170 CertCloseStore, 0> > ScopedHCERTSTORE; |
| 170 | 171 |
| 171 ScopedHCERTSTORE test_store(CertOpenStore(CERT_STORE_PROV_MEMORY, 0, NULL, 0, | 172 ScopedHCERTSTORE test_store(CertOpenStore(CERT_STORE_PROV_MEMORY, 0, NULL, 0, |
| 172 NULL)); | 173 NULL)); |
| 173 if (!test_store) | 174 if (!test_store) |
| 174 return false; | 175 return false; |
| 175 | 176 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 195 // copy). | 196 // copy). |
| 196 if (!CertFreeCertificateContext(cert)) | 197 if (!CertFreeCertificateContext(cert)) |
| 197 return false; | 198 return false; |
| 198 } | 199 } |
| 199 | 200 |
| 200 bool rv = GetClientCertsImpl(test_store.get(), request, selected_certs); | 201 bool rv = GetClientCertsImpl(test_store.get(), request, selected_certs); |
| 201 return rv; | 202 return rv; |
| 202 } | 203 } |
| 203 | 204 |
| 204 } // namespace net | 205 } // namespace net |
| OLD | NEW |