| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/socket/ssl_client_socket_win.h" | 5 #include "net/socket/ssl_client_socket_win.h" |
| 6 | 6 |
| 7 #include <schnlsp.h> | 7 #include <schnlsp.h> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/lock.h" | 10 #include "base/lock.h" |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 SECURITY_STATUS status = QueryContextAttributes( | 363 SECURITY_STATUS status = QueryContextAttributes( |
| 364 &ctxt_, SECPKG_ATTR_ISSUER_LIST_EX, &issuer_list); | 364 &ctxt_, SECPKG_ATTR_ISSUER_LIST_EX, &issuer_list); |
| 365 if (status != SEC_E_OK) { | 365 if (status != SEC_E_OK) { |
| 366 DLOG(ERROR) << "QueryContextAttributes (issuer list) failed: " << status; | 366 DLOG(ERROR) << "QueryContextAttributes (issuer list) failed: " << status; |
| 367 return; | 367 return; |
| 368 } | 368 } |
| 369 | 369 |
| 370 // Client certificates of the user are in the "MY" system certificate store. | 370 // Client certificates of the user are in the "MY" system certificate store. |
| 371 HCERTSTORE my_cert_store = CertOpenSystemStore(NULL, L"MY"); | 371 HCERTSTORE my_cert_store = CertOpenSystemStore(NULL, L"MY"); |
| 372 if (!my_cert_store) { | 372 if (!my_cert_store) { |
| 373 LOG(ERROR) << "Could not open the \"MY\" system certificate store: " |
| 374 << GetLastError(); |
| 373 FreeContextBuffer(issuer_list.aIssuers); | 375 FreeContextBuffer(issuer_list.aIssuers); |
| 374 return; | 376 return; |
| 375 } | 377 } |
| 376 | 378 |
| 377 // Enumerate the client certificates. | 379 // Enumerate the client certificates. |
| 378 CERT_CHAIN_FIND_BY_ISSUER_PARA find_by_issuer_para; | 380 CERT_CHAIN_FIND_BY_ISSUER_PARA find_by_issuer_para; |
| 379 memset(&find_by_issuer_para, 0, sizeof(find_by_issuer_para)); | 381 memset(&find_by_issuer_para, 0, sizeof(find_by_issuer_para)); |
| 380 find_by_issuer_para.cbSize = sizeof(find_by_issuer_para); | 382 find_by_issuer_para.cbSize = sizeof(find_by_issuer_para); |
| 381 find_by_issuer_para.pszUsageIdentifier = szOID_PKIX_KP_CLIENT_AUTH; | 383 find_by_issuer_para.pszUsageIdentifier = szOID_PKIX_KP_CLIENT_AUTH; |
| 382 find_by_issuer_para.cIssuer = issuer_list.cIssuers; | 384 find_by_issuer_para.cIssuer = issuer_list.cIssuers; |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); | 1338 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); |
| 1337 } | 1339 } |
| 1338 | 1340 |
| 1339 void SSLClientSocketWin::FreeSendBuffer() { | 1341 void SSLClientSocketWin::FreeSendBuffer() { |
| 1340 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); | 1342 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); |
| 1341 DCHECK(status == SEC_E_OK); | 1343 DCHECK(status == SEC_E_OK); |
| 1342 memset(&send_buffer_, 0, sizeof(send_buffer_)); | 1344 memset(&send_buffer_, 0, sizeof(send_buffer_)); |
| 1343 } | 1345 } |
| 1344 | 1346 |
| 1345 } // namespace net | 1347 } // namespace net |
| OLD | NEW |