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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 int Write(IOBuffer* buf, | 96 int Write(IOBuffer* buf, |
97 int buf_len, | 97 int buf_len, |
98 const CompletionCallback& callback) override; | 98 const CompletionCallback& callback) override; |
99 int SetReceiveBufferSize(int32 size) override; | 99 int SetReceiveBufferSize(int32 size) override; |
100 int SetSendBufferSize(int32 size) override; | 100 int SetSendBufferSize(int32 size) override; |
101 | 101 |
102 protected: | 102 protected: |
103 // SSLClientSocket implementation. | 103 // SSLClientSocket implementation. |
104 scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() | 104 scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() |
105 const override; | 105 const override; |
| 106 void ForceClientCertificateAndKeyForTest( |
| 107 scoped_refptr<X509Certificate> client_cert, |
| 108 scoped_ptr<crypto::RSAPrivateKey> client_private_key) override; |
106 | 109 |
107 private: | 110 private: |
108 class PeerCertificateChain; | 111 class PeerCertificateChain; |
109 class SSLContext; | 112 class SSLContext; |
110 friend class SSLClientSocket; | 113 friend class SSLClientSocket; |
111 friend class SSLContext; | 114 friend class SSLContext; |
112 | 115 |
113 int Init(); | 116 int Init(); |
114 void DoReadCallback(int result); | 117 void DoReadCallback(int result); |
115 void DoWriteCallback(int result); | 118 void DoWriteCallback(int result); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 309 |
307 TransportSecurityState* transport_security_state_; | 310 TransportSecurityState* transport_security_state_; |
308 | 311 |
309 CertPolicyEnforcer* const policy_enforcer_; | 312 CertPolicyEnforcer* const policy_enforcer_; |
310 | 313 |
311 // pinning_failure_log contains a message produced by | 314 // pinning_failure_log contains a message produced by |
312 // TransportSecurityState::CheckPublicKeyPins in the event of a | 315 // TransportSecurityState::CheckPublicKeyPins in the event of a |
313 // pinning failure. It is a (somewhat) human-readable string. | 316 // pinning failure. It is a (somewhat) human-readable string. |
314 std::string pinning_failure_log_; | 317 std::string pinning_failure_log_; |
315 | 318 |
| 319 // Used only for unit testing. |
| 320 scoped_ptr<crypto::RSAPrivateKey> client_private_key_; |
| 321 |
316 BoundNetLog net_log_; | 322 BoundNetLog net_log_; |
317 base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_; | 323 base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_; |
318 }; | 324 }; |
319 | 325 |
320 } // namespace net | 326 } // namespace net |
321 | 327 |
322 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 328 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
OLD | NEW |