Chromium Code Reviews| 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 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 // SSLClientSocket implementation. | 99 // SSLClientSocket implementation. |
| 100 virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() | 100 virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() |
| 101 const OVERRIDE; | 101 const OVERRIDE; |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 class PeerCertificateChain; | 104 class PeerCertificateChain; |
| 105 class SSLContext; | 105 class SSLContext; |
| 106 friend class SSLClientSocket; | 106 friend class SSLClientSocket; |
| 107 friend class SSLContext; | 107 friend class SSLContext; |
| 108 | 108 |
| 109 // Callback that is run by OpenSSL when a session's handshake has finished. | |
| 110 static void OnSessionFinishedCallback(const SSL* ssl, int result, int unused); | |
|
wtc
2014/08/07 02:10:12
This callback should be named "InfoCallback", and
| |
| 111 | |
| 109 int Init(); | 112 int Init(); |
| 110 void DoReadCallback(int result); | 113 void DoReadCallback(int result); |
| 111 void DoWriteCallback(int result); | 114 void DoWriteCallback(int result); |
| 112 | 115 |
| 113 // Compute a unique key string for the SSL session cache. | 116 // Compute a unique key string for the SSL session cache. |
| 114 std::string GetSessionCacheKey() const; | 117 std::string GetSessionCacheKey() const; |
| 115 void OnHandshakeCompletion(); | 118 void OnHandshakeCompletion(); |
| 116 | 119 |
| 117 bool DoTransportIO(); | 120 bool DoTransportIO(); |
| 118 int DoHandshake(); | 121 int DoHandshake(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 const char *argp, int argi, long argl, | 164 const char *argp, int argi, long argl, |
| 162 long retvalue); | 165 long retvalue); |
| 163 | 166 |
| 164 // Callback from the SSL layer when an operation is performed on | 167 // Callback from the SSL layer when an operation is performed on |
| 165 // |transport_bio_|'s peer. | 168 // |transport_bio_|'s peer. |
| 166 static long BIOCallback(BIO *bio, | 169 static long BIOCallback(BIO *bio, |
| 167 int cmd, | 170 int cmd, |
| 168 const char *argp, int argi, long argl, | 171 const char *argp, int argi, long argl, |
| 169 long retvalue); | 172 long retvalue); |
| 170 | 173 |
| 174 void CheckIfSessionFinished(); | |
|
wtc
2014/08/07 02:10:12
SessionFinished => HandshakeFinished
| |
| 175 | |
| 171 bool transport_send_busy_; | 176 bool transport_send_busy_; |
| 172 bool transport_recv_busy_; | 177 bool transport_recv_busy_; |
| 173 | 178 |
| 174 scoped_refptr<DrainableIOBuffer> send_buffer_; | 179 scoped_refptr<DrainableIOBuffer> send_buffer_; |
| 175 scoped_refptr<IOBuffer> recv_buffer_; | 180 scoped_refptr<IOBuffer> recv_buffer_; |
| 176 | 181 |
| 177 CompletionCallback user_connect_callback_; | 182 CompletionCallback user_connect_callback_; |
| 178 CompletionCallback user_read_callback_; | 183 CompletionCallback user_read_callback_; |
| 179 CompletionCallback user_write_callback_; | 184 CompletionCallback user_write_callback_; |
| 180 | 185 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 STATE_VERIFY_CERT_COMPLETE, | 266 STATE_VERIFY_CERT_COMPLETE, |
| 262 }; | 267 }; |
| 263 State next_handshake_state_; | 268 State next_handshake_state_; |
| 264 NextProtoStatus npn_status_; | 269 NextProtoStatus npn_status_; |
| 265 std::string npn_proto_; | 270 std::string npn_proto_; |
| 266 // Written by the |channel_id_service_|. | 271 // Written by the |channel_id_service_|. |
| 267 std::string channel_id_private_key_; | 272 std::string channel_id_private_key_; |
| 268 std::string channel_id_cert_; | 273 std::string channel_id_cert_; |
| 269 // True if channel ID extension was negotiated. | 274 // True if channel ID extension was negotiated. |
| 270 bool channel_id_xtn_negotiated_; | 275 bool channel_id_xtn_negotiated_; |
| 276 // True if OnSessionFinishedCallback has been run. | |
|
wtc
2014/08/07 02:10:12
This comment is wrong. It should say something lik
| |
| 277 bool ran_session_finished_callback_; | |
|
wtc
2014/08/07 02:10:12
Change "session finished" to "handshake finished"
| |
| 271 // The request handle for |channel_id_service_|. | 278 // The request handle for |channel_id_service_|. |
| 272 ChannelIDService::RequestHandle channel_id_request_handle_; | 279 ChannelIDService::RequestHandle channel_id_request_handle_; |
| 273 BoundNetLog net_log_; | 280 BoundNetLog net_log_; |
| 274 }; | 281 }; |
| 275 | 282 |
| 276 } // namespace net | 283 } // namespace net |
| 277 | 284 |
| 278 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 285 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| OLD | NEW |