Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_MAC_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
| 15 #include "net/base/cert_verify_result.h" | 15 #include "net/base/cert_verify_result.h" |
| 16 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
| 17 #include "net/base/host_and_port.h" | |
| 17 #include "net/base/net_log.h" | 18 #include "net/base/net_log.h" |
| 18 #include "net/base/ssl_config_service.h" | 19 #include "net/base/ssl_config_service.h" |
| 19 #include "net/socket/ssl_client_socket.h" | 20 #include "net/socket/ssl_client_socket.h" |
| 20 | 21 |
| 21 namespace net { | 22 namespace net { |
| 22 | 23 |
| 23 class CertVerifier; | 24 class CertVerifier; |
| 24 class ClientSocketHandle; | 25 class ClientSocketHandle; |
| 25 | 26 |
| 26 // An SSL client socket implemented with Secure Transport. | 27 // An SSL client socket implemented with Secure Transport. |
| 27 class SSLClientSocketMac : public SSLClientSocket { | 28 class SSLClientSocketMac : public SSLClientSocket { |
| 28 public: | 29 public: |
| 29 // Takes ownership of the |transport_socket|, which must already be connected. | 30 // Takes ownership of the |transport_socket|, which must already be connected. |
| 30 // The given hostname will be compared with the name(s) in the server's | 31 // The given hostname will be compared with the name(s) in the server's |
|
eroman
2010/11/12 01:12:56
nit: should this comment be adjusted to mention po
Ryan Hamilton
2010/11/12 16:47:26
Done, for all 3 SSLClientSocket subclasses.
| |
| 31 // certificate during the SSL handshake. ssl_config specifies the SSL | 32 // certificate during the SSL handshake. ssl_config specifies the SSL |
| 32 // settings. | 33 // settings. |
| 33 SSLClientSocketMac(ClientSocketHandle* transport_socket, | 34 SSLClientSocketMac(ClientSocketHandle* transport_socket, |
| 34 const std::string& hostname, | 35 const HostPortPair& host_and_port, |
| 35 const SSLConfig& ssl_config); | 36 const SSLConfig& ssl_config); |
| 36 ~SSLClientSocketMac(); | 37 ~SSLClientSocketMac(); |
| 37 | 38 |
| 38 // SSLClientSocket methods: | 39 // SSLClientSocket methods: |
| 39 virtual void GetSSLInfo(SSLInfo* ssl_info); | 40 virtual void GetSSLInfo(SSLInfo* ssl_info); |
| 40 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 41 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 41 virtual NextProtoStatus GetNextProto(std::string* proto); | 42 virtual NextProtoStatus GetNextProto(std::string* proto); |
| 42 | 43 |
| 43 // ClientSocket methods: | 44 // ClientSocket methods: |
| 44 virtual int Connect(CompletionCallback* callback); | 45 virtual int Connect(CompletionCallback* callback); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 size_t* data_length); | 92 size_t* data_length); |
| 92 static OSStatus SSLWriteCallback(SSLConnectionRef connection, | 93 static OSStatus SSLWriteCallback(SSLConnectionRef connection, |
| 93 const void* data, | 94 const void* data, |
| 94 size_t* data_length); | 95 size_t* data_length); |
| 95 | 96 |
| 96 CompletionCallbackImpl<SSLClientSocketMac> handshake_io_callback_; | 97 CompletionCallbackImpl<SSLClientSocketMac> handshake_io_callback_; |
| 97 CompletionCallbackImpl<SSLClientSocketMac> transport_read_callback_; | 98 CompletionCallbackImpl<SSLClientSocketMac> transport_read_callback_; |
| 98 CompletionCallbackImpl<SSLClientSocketMac> transport_write_callback_; | 99 CompletionCallbackImpl<SSLClientSocketMac> transport_write_callback_; |
| 99 | 100 |
| 100 scoped_ptr<ClientSocketHandle> transport_; | 101 scoped_ptr<ClientSocketHandle> transport_; |
| 101 std::string hostname_; | 102 HostPortPair host_and_port_; |
| 102 SSLConfig ssl_config_; | 103 SSLConfig ssl_config_; |
| 103 | 104 |
| 104 CompletionCallback* user_connect_callback_; | 105 CompletionCallback* user_connect_callback_; |
| 105 CompletionCallback* user_read_callback_; | 106 CompletionCallback* user_read_callback_; |
| 106 CompletionCallback* user_write_callback_; | 107 CompletionCallback* user_write_callback_; |
| 107 | 108 |
| 108 // Used by Read function. | 109 // Used by Read function. |
| 109 scoped_refptr<IOBuffer> user_read_buf_; | 110 scoped_refptr<IOBuffer> user_read_buf_; |
| 110 int user_read_buf_len_; | 111 int user_read_buf_len_; |
| 111 | 112 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 // These are the IOBuffers used for operations on the underlying transport. | 153 // These are the IOBuffers used for operations on the underlying transport. |
| 153 scoped_refptr<IOBuffer> read_io_buf_; | 154 scoped_refptr<IOBuffer> read_io_buf_; |
| 154 scoped_refptr<IOBuffer> write_io_buf_; | 155 scoped_refptr<IOBuffer> write_io_buf_; |
| 155 | 156 |
| 156 BoundNetLog net_log_; | 157 BoundNetLog net_log_; |
| 157 }; | 158 }; |
| 158 | 159 |
| 159 } // namespace net | 160 } // namespace net |
| 160 | 161 |
| 161 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ | 162 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ |
| OLD | NEW |