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_NSS_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
6 #define NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
7 | 7 |
8 #include <certt.h> | 8 #include <certt.h> |
9 #include <keyt.h> | 9 #include <keyt.h> |
10 #include <nspr.h> | 10 #include <nspr.h> |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "net/ssl/ssl_config_service.h" | 32 #include "net/ssl/ssl_config_service.h" |
33 | 33 |
34 namespace net { | 34 namespace net { |
35 | 35 |
36 class BoundNetLog; | 36 class BoundNetLog; |
37 class CertPolicyEnforcer; | 37 class CertPolicyEnforcer; |
38 class CertVerifier; | 38 class CertVerifier; |
39 class ChannelIDService; | 39 class ChannelIDService; |
40 class CTVerifier; | 40 class CTVerifier; |
41 class ClientSocketHandle; | 41 class ClientSocketHandle; |
| 42 class SSLPrivateKey; |
42 class TransportSecurityState; | 43 class TransportSecurityState; |
43 class X509Certificate; | 44 class X509Certificate; |
44 | 45 |
45 // An SSL client socket implemented with Mozilla NSS. | 46 // An SSL client socket implemented with Mozilla NSS. |
46 class SSLClientSocketNSS : public SSLClientSocket { | 47 class SSLClientSocketNSS : public SSLClientSocket { |
47 public: | 48 public: |
48 // Takes ownership of the |transport_socket|, which must already be connected. | 49 // Takes ownership of the |transport_socket|, which must already be connected. |
49 // The hostname specified in |host_and_port| will be compared with the name(s) | 50 // The hostname specified in |host_and_port| will be compared with the name(s) |
50 // in the server's certificate during the SSL handshake. If SSL client | 51 // in the server's certificate during the SSL handshake. If SSL client |
51 // authentication is requested, the host_and_port field of SSLCertRequestInfo | 52 // authentication is requested, the host_and_port field of SSLCertRequestInfo |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 const CompletionCallback& callback) override; | 94 const CompletionCallback& callback) override; |
94 int Write(IOBuffer* buf, | 95 int Write(IOBuffer* buf, |
95 int buf_len, | 96 int buf_len, |
96 const CompletionCallback& callback) override; | 97 const CompletionCallback& callback) override; |
97 int SetReceiveBufferSize(int32 size) override; | 98 int SetReceiveBufferSize(int32 size) override; |
98 int SetSendBufferSize(int32 size) override; | 99 int SetSendBufferSize(int32 size) override; |
99 | 100 |
100 // SSLClientSocket implementation. | 101 // SSLClientSocket implementation. |
101 ChannelIDService* GetChannelIDService() const override; | 102 ChannelIDService* GetChannelIDService() const override; |
102 SSLFailureState GetSSLFailureState() const override; | 103 SSLFailureState GetSSLFailureState() const override; |
| 104 void ForceClientCertificateAndKeyForTest( |
| 105 scoped_refptr<X509Certificate> client_cert, |
| 106 scoped_ptr<SSLPrivateKey> client_private_key) override; |
103 | 107 |
104 private: | 108 private: |
105 // Helper class to handle marshalling any NSS interaction to and from the | 109 // Helper class to handle marshalling any NSS interaction to and from the |
106 // NSS and network task runners. Not every call needs to happen on the Core | 110 // NSS and network task runners. Not every call needs to happen on the Core |
107 class Core; | 111 class Core; |
108 | 112 |
109 enum State { | 113 enum State { |
110 STATE_NONE, | 114 STATE_NONE, |
111 STATE_HANDSHAKE, | 115 STATE_HANDSHAKE, |
112 STATE_HANDSHAKE_COMPLETE, | 116 STATE_HANDSHAKE_COMPLETE, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // Added the following code Debugging in release mode. | 212 // Added the following code Debugging in release mode. |
209 mutable base::Lock lock_; | 213 mutable base::Lock lock_; |
210 // This is mutable so that CalledOnValidThread can set it. | 214 // This is mutable so that CalledOnValidThread can set it. |
211 // It's guarded by |lock_|. | 215 // It's guarded by |lock_|. |
212 mutable base::PlatformThreadId valid_thread_id_; | 216 mutable base::PlatformThreadId valid_thread_id_; |
213 }; | 217 }; |
214 | 218 |
215 } // namespace net | 219 } // namespace net |
216 | 220 |
217 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ | 221 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
OLD | NEW |