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 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ |
6 #define NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ |
7 | 7 |
8 #define SECURITY_WIN32 // Needs to be defined before including security.h | 8 #define SECURITY_WIN32 // Needs to be defined before including security.h |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
11 #include <wincrypt.h> | 11 #include <wincrypt.h> |
12 #include <security.h> | 12 #include <security.h> |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
17 #include "net/base/cert_verify_result.h" | 17 #include "net/base/cert_verify_result.h" |
18 #include "net/base/completion_callback.h" | 18 #include "net/base/completion_callback.h" |
| 19 #include "net/base/net_log.h" |
19 #include "net/base/ssl_config_service.h" | 20 #include "net/base/ssl_config_service.h" |
20 #include "net/socket/ssl_client_socket.h" | 21 #include "net/socket/ssl_client_socket.h" |
21 | 22 |
22 namespace net { | 23 namespace net { |
23 | 24 |
24 class CertVerifier; | 25 class CertVerifier; |
25 class LoadLog; | 26 class BoundNetLog; |
26 | 27 |
27 // An SSL client socket implemented with the Windows Schannel. | 28 // An SSL client socket implemented with the Windows Schannel. |
28 class SSLClientSocketWin : public SSLClientSocket { | 29 class SSLClientSocketWin : public SSLClientSocket { |
29 public: | 30 public: |
30 // Takes ownership of the transport_socket, which may already be connected. | 31 // Takes ownership of the transport_socket, which may already be connected. |
31 // The given hostname will be compared with the name(s) in the server's | 32 // The given hostname will be compared with the name(s) in the server's |
32 // certificate during the SSL handshake. ssl_config specifies the SSL | 33 // certificate during the SSL handshake. ssl_config specifies the SSL |
33 // settings. | 34 // settings. |
34 SSLClientSocketWin(ClientSocket* transport_socket, | 35 SSLClientSocketWin(ClientSocket* transport_socket, |
35 const std::string& hostname, | 36 const std::string& hostname, |
36 const SSLConfig& ssl_config); | 37 const SSLConfig& ssl_config); |
37 ~SSLClientSocketWin(); | 38 ~SSLClientSocketWin(); |
38 | 39 |
39 // SSLClientSocket methods: | 40 // SSLClientSocket methods: |
40 virtual void GetSSLInfo(SSLInfo* ssl_info); | 41 virtual void GetSSLInfo(SSLInfo* ssl_info); |
41 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 42 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
42 virtual NextProtoStatus GetNextProto(std::string* proto); | 43 virtual NextProtoStatus GetNextProto(std::string* proto); |
43 | 44 |
44 // ClientSocket methods: | 45 // ClientSocket methods: |
45 virtual int Connect(CompletionCallback* callback, LoadLog* load_log); | 46 virtual int Connect(CompletionCallback* callback, const BoundNetLog& net_log); |
46 virtual void Disconnect(); | 47 virtual void Disconnect(); |
47 virtual bool IsConnected() const; | 48 virtual bool IsConnected() const; |
48 virtual bool IsConnectedAndIdle() const; | 49 virtual bool IsConnectedAndIdle() const; |
49 virtual int GetPeerAddress(AddressList* address) const; | 50 virtual int GetPeerAddress(AddressList* address) const; |
50 | 51 |
51 // Socket methods: | 52 // Socket methods: |
52 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 53 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
53 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 54 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
54 | 55 |
55 virtual bool SetReceiveBufferSize(int32 size); | 56 virtual bool SetReceiveBufferSize(int32 size); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // We have to pass a 'result' of OK to the DoLoop method, and don't want it | 175 // We have to pass a 'result' of OK to the DoLoop method, and don't want it |
175 // to be interpreted as EOF. | 176 // to be interpreted as EOF. |
176 bool ignore_ok_result_; | 177 bool ignore_ok_result_; |
177 | 178 |
178 // Renegotiation is in progress. | 179 // Renegotiation is in progress. |
179 bool renegotiating_; | 180 bool renegotiating_; |
180 | 181 |
181 // True when the decrypter needs more data in order to decrypt. | 182 // True when the decrypter needs more data in order to decrypt. |
182 bool need_more_data_; | 183 bool need_more_data_; |
183 | 184 |
184 scoped_refptr<LoadLog> load_log_; | 185 BoundNetLog net_log_; |
185 }; | 186 }; |
186 | 187 |
187 } // namespace net | 188 } // namespace net |
188 | 189 |
189 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ | 190 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ |
OLD | NEW |