| 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_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 #pragma once | 7 #pragma once | 
| 8 | 8 | 
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" | 
| 10 #include "net/base/cert_verify_result.h" | 10 #include "net/base/cert_verify_result.h" | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 26 | 26 | 
| 27 // An SSL client socket implemented with OpenSSL. | 27 // An SSL client socket implemented with OpenSSL. | 
| 28 class SSLClientSocketOpenSSL : public SSLClientSocket { | 28 class SSLClientSocketOpenSSL : public SSLClientSocket { | 
| 29  public: | 29  public: | 
| 30   // Takes ownership of the transport_socket, which may already be connected. | 30   // 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 | 31   // 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 | 32   // certificate during the SSL handshake.  ssl_config specifies the SSL | 
| 33   // settings. | 33   // settings. | 
| 34   SSLClientSocketOpenSSL(ClientSocketHandle* transport_socket, | 34   SSLClientSocketOpenSSL(ClientSocketHandle* transport_socket, | 
| 35                          const std::string& hostname, | 35                          const std::string& hostname, | 
|  | 36                          uint16 port, | 
| 36                          const SSLConfig& ssl_config); | 37                          const SSLConfig& ssl_config); | 
| 37   ~SSLClientSocketOpenSSL(); | 38   ~SSLClientSocketOpenSSL(); | 
| 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); | 46   virtual int Connect(CompletionCallback* callback); | 
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 119 | 120 | 
| 120   scoped_ptr<CertVerifier> verifier_; | 121   scoped_ptr<CertVerifier> verifier_; | 
| 121   CompletionCallbackImpl<SSLClientSocketOpenSSL> handshake_io_callback_; | 122   CompletionCallbackImpl<SSLClientSocketOpenSSL> handshake_io_callback_; | 
| 122 | 123 | 
| 123   // OpenSSL stuff | 124   // OpenSSL stuff | 
| 124   SSL* ssl_; | 125   SSL* ssl_; | 
| 125   BIO* transport_bio_; | 126   BIO* transport_bio_; | 
| 126 | 127 | 
| 127   scoped_ptr<ClientSocketHandle> transport_; | 128   scoped_ptr<ClientSocketHandle> transport_; | 
| 128   std::string hostname_; | 129   std::string hostname_; | 
|  | 130   uint16 port_; | 
| 129   SSLConfig ssl_config_; | 131   SSLConfig ssl_config_; | 
| 130 | 132 | 
| 131   bool completed_handshake_; | 133   bool completed_handshake_; | 
| 132 | 134 | 
| 133   enum State { | 135   enum State { | 
| 134     STATE_NONE, | 136     STATE_NONE, | 
| 135     STATE_HANDSHAKE, | 137     STATE_HANDSHAKE, | 
| 136     STATE_VERIFY_CERT, | 138     STATE_VERIFY_CERT, | 
| 137     STATE_VERIFY_CERT_COMPLETE, | 139     STATE_VERIFY_CERT_COMPLETE, | 
| 138   }; | 140   }; | 
| 139   State next_handshake_state_; | 141   State next_handshake_state_; | 
| 140   BoundNetLog net_log_; | 142   BoundNetLog net_log_; | 
| 141 }; | 143 }; | 
| 142 | 144 | 
| 143 }  // namespace net | 145 }  // namespace net | 
| 144 | 146 | 
| 145 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 147 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 
| 146 | 148 | 
| OLD | NEW | 
|---|