OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 base::Lock lock_; | 189 base::Lock lock_; |
190 | 190 |
191 // Anonymous (no client certificate) CredHandles for all possible | 191 // Anonymous (no client certificate) CredHandles for all possible |
192 // combinations of SSL versions. Defined as an array for fast lookup. | 192 // combinations of SSL versions. Defined as an array for fast lookup. |
193 CredHandleClass anonymous_creds_[SSL_VERSION_MASKS]; | 193 CredHandleClass anonymous_creds_[SSL_VERSION_MASKS]; |
194 | 194 |
195 // CredHandles that use a client certificate. | 195 // CredHandles that use a client certificate. |
196 CredHandleMap client_cert_creds_; | 196 CredHandleMap client_cert_creds_; |
197 }; | 197 }; |
198 | 198 |
199 static base::LazyInstance<CredHandleTable> g_cred_handle_table( | 199 static base::LazyInstance<CredHandleTable> g_cred_handle_table = |
200 base::LINKER_INITIALIZED); | 200 LAZY_INSTANCE_INITIALIZER; |
201 | 201 |
202 // static | 202 // static |
203 int CredHandleTable::InitializeHandle(CredHandle* handle, | 203 int CredHandleTable::InitializeHandle(CredHandle* handle, |
204 PCCERT_CONTEXT client_cert, | 204 PCCERT_CONTEXT client_cert, |
205 int ssl_version_mask) { | 205 int ssl_version_mask) { |
206 SCHANNEL_CRED schannel_cred = {0}; | 206 SCHANNEL_CRED schannel_cred = {0}; |
207 schannel_cred.dwVersion = SCHANNEL_CRED_VERSION; | 207 schannel_cred.dwVersion = SCHANNEL_CRED_VERSION; |
208 if (client_cert) { | 208 if (client_cert) { |
209 schannel_cred.cCreds = 1; | 209 schannel_cred.cCreds = 1; |
210 schannel_cred.paCred = &client_cert; | 210 schannel_cred.paCred = &client_cert; |
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); | 1567 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); |
1568 } | 1568 } |
1569 | 1569 |
1570 void SSLClientSocketWin::FreeSendBuffer() { | 1570 void SSLClientSocketWin::FreeSendBuffer() { |
1571 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); | 1571 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); |
1572 DCHECK(status == SEC_E_OK); | 1572 DCHECK(status == SEC_E_OK); |
1573 memset(&send_buffer_, 0, sizeof(send_buffer_)); | 1573 memset(&send_buffer_, 0, sizeof(send_buffer_)); |
1574 } | 1574 } |
1575 | 1575 |
1576 } // namespace net | 1576 } // namespace net |
OLD | NEW |