| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <certt.h> | 9 #include <certt.h> |
| 10 #include <keyt.h> | 10 #include <keyt.h> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // ClientSocket methods: | 55 // ClientSocket methods: |
| 56 virtual int Connect(CompletionCallback* callback); | 56 virtual int Connect(CompletionCallback* callback); |
| 57 virtual void Disconnect(); | 57 virtual void Disconnect(); |
| 58 virtual bool IsConnected() const; | 58 virtual bool IsConnected() const; |
| 59 virtual bool IsConnectedAndIdle() const; | 59 virtual bool IsConnectedAndIdle() const; |
| 60 virtual int GetPeerAddress(AddressList* address) const; | 60 virtual int GetPeerAddress(AddressList* address) const; |
| 61 virtual const BoundNetLog& NetLog() const { return net_log_; } | 61 virtual const BoundNetLog& NetLog() const { return net_log_; } |
| 62 virtual void SetSubresourceSpeculation(); | 62 virtual void SetSubresourceSpeculation(); |
| 63 virtual void SetOmniboxSpeculation(); | 63 virtual void SetOmniboxSpeculation(); |
| 64 virtual bool WasEverUsed() const; | 64 virtual bool WasEverUsed() const; |
| 65 virtual bool UsingTCPFastOpen() const; |
| 65 | 66 |
| 66 // Socket methods: | 67 // Socket methods: |
| 67 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 68 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
| 68 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 69 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
| 69 virtual bool SetReceiveBufferSize(int32 size); | 70 virtual bool SetReceiveBufferSize(int32 size); |
| 70 virtual bool SetSendBufferSize(int32 size); | 71 virtual bool SetSendBufferSize(int32 size); |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 // Initializes NSS SSL options. Returns a net error code. | 74 // Initializes NSS SSL options. Returns a net error code. |
| 74 int InitializeSSLOptions(); | 75 int InitializeSSLOptions(); |
| 75 | 76 |
| 77 // Initializes the socket peer name in SSL. Returns a net error code. |
| 78 int InitializeSSLPeerName(); |
| 79 |
| 76 void InvalidateSessionIfBadCertificate(); | 80 void InvalidateSessionIfBadCertificate(); |
| 77 #if defined(OS_MACOSX) || defined(OS_WIN) | 81 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 78 // Creates an OS certificate from a DER-encoded certificate. | 82 // Creates an OS certificate from a DER-encoded certificate. |
| 79 static X509Certificate::OSCertHandle CreateOSCert(const SECItem& der_cert); | 83 static X509Certificate::OSCertHandle CreateOSCert(const SECItem& der_cert); |
| 80 #endif | 84 #endif |
| 81 X509Certificate* UpdateServerCert(); | 85 X509Certificate* UpdateServerCert(); |
| 82 void CheckSecureRenegotiation() const; | 86 void CheckSecureRenegotiation() const; |
| 83 void DoReadCallback(int result); | 87 void DoReadCallback(int result); |
| 84 void DoWriteCallback(int result); | 88 void DoWriteCallback(int result); |
| 85 void DoConnectCallback(int result); | 89 void DoConnectCallback(int result); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 bool pseudo_connected_; | 185 bool pseudo_connected_; |
| 182 | 186 |
| 183 // True iff we believe that the user has an ESET product intercepting our | 187 // True iff we believe that the user has an ESET product intercepting our |
| 184 // HTTPS connections. | 188 // HTTPS connections. |
| 185 bool eset_mitm_detected_; | 189 bool eset_mitm_detected_; |
| 186 | 190 |
| 187 // True iff we believe that the user has NetNanny intercepting our HTTPS | 191 // True iff we believe that the user has NetNanny intercepting our HTTPS |
| 188 // connections. | 192 // connections. |
| 189 bool netnanny_mitm_detected_; | 193 bool netnanny_mitm_detected_; |
| 190 | 194 |
| 195 // True if the peer name has been initialized. |
| 196 bool peername_initialized_; |
| 197 |
| 191 // This pointer is owned by the caller of UseDNSSEC. | 198 // This pointer is owned by the caller of UseDNSSEC. |
| 192 DNSSECProvider* dnssec_provider_; | 199 DNSSECProvider* dnssec_provider_; |
| 193 // The time when we started waiting for DNSSEC records. | 200 // The time when we started waiting for DNSSEC records. |
| 194 base::Time dnssec_wait_start_time_; | 201 base::Time dnssec_wait_start_time_; |
| 195 | 202 |
| 196 enum State { | 203 enum State { |
| 197 STATE_NONE, | 204 STATE_NONE, |
| 198 STATE_SNAP_START_LOAD_INFO, | 205 STATE_SNAP_START_LOAD_INFO, |
| 199 STATE_SNAP_START_WAIT_FOR_WRITE, | 206 STATE_SNAP_START_WAIT_FOR_WRITE, |
| 200 STATE_HANDSHAKE, | 207 STATE_HANDSHAKE, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 230 // 2. Copy client certificates from the "MY" system certificate store into | 237 // 2. Copy client certificates from the "MY" system certificate store into |
| 231 // this store so that we can close the system store when we finish | 238 // this store so that we can close the system store when we finish |
| 232 // searching for client certificates. | 239 // searching for client certificates. |
| 233 static HCERTSTORE cert_store_; | 240 static HCERTSTORE cert_store_; |
| 234 #endif | 241 #endif |
| 235 }; | 242 }; |
| 236 | 243 |
| 237 } // namespace net | 244 } // namespace net |
| 238 | 245 |
| 239 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ | 246 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
| OLD | NEW |