| 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_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ | 5 #ifndef NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ |
| 6 #define NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ | 6 #define NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ |
| 7 | 7 |
| 8 #include <cstdint> | 8 #include <cstdint> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // Sends the latest server config and source-address token to the client. | 51 // Sends the latest server config and source-address token to the client. |
| 52 virtual void SendServerConfigUpdate( | 52 virtual void SendServerConfigUpdate( |
| 53 const CachedNetworkParameters* cached_network_params) = 0; | 53 const CachedNetworkParameters* cached_network_params) = 0; |
| 54 | 54 |
| 55 // These are all accessors and setters to their respective counters. | 55 // These are all accessors and setters to their respective counters. |
| 56 virtual uint8_t NumHandshakeMessages() const = 0; | 56 virtual uint8_t NumHandshakeMessages() const = 0; |
| 57 virtual uint8_t NumHandshakeMessagesWithServerNonces() const = 0; | 57 virtual uint8_t NumHandshakeMessagesWithServerNonces() const = 0; |
| 58 virtual bool UseStatelessRejectsIfPeerSupported() const = 0; | 58 virtual bool UseStatelessRejectsIfPeerSupported() const = 0; |
| 59 virtual bool PeerSupportsStatelessRejects() const = 0; | 59 virtual bool PeerSupportsStatelessRejects() const = 0; |
| 60 virtual bool ZeroRttAttempted() const = 0; |
| 60 virtual void SetPeerSupportsStatelessRejects(bool set) = 0; | 61 virtual void SetPeerSupportsStatelessRejects(bool set) = 0; |
| 61 virtual const CachedNetworkParameters* PreviousCachedNetworkParams() | 62 virtual const CachedNetworkParameters* PreviousCachedNetworkParams() |
| 62 const = 0; | 63 const = 0; |
| 63 virtual void SetPreviousCachedNetworkParams( | 64 virtual void SetPreviousCachedNetworkParams( |
| 64 CachedNetworkParameters cached_network_params) = 0; | 65 CachedNetworkParameters cached_network_params) = 0; |
| 65 | 66 |
| 66 // Checks the options on the handshake-message to see whether the | 67 // Checks the options on the handshake-message to see whether the |
| 67 // peer supports stateless-rejects. | 68 // peer supports stateless-rejects. |
| 68 static bool DoesPeerSupportStatelessRejects( | 69 static bool DoesPeerSupportStatelessRejects( |
| 69 const CryptoHandshakeMessage& message); | 70 const CryptoHandshakeMessage& message); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 void OnHandshakeMessage(const CryptoHandshakeMessage& message) override; | 106 void OnHandshakeMessage(const CryptoHandshakeMessage& message) override; |
| 106 bool GetBase64SHA256ClientChannelID(std::string* output) const override; | 107 bool GetBase64SHA256ClientChannelID(std::string* output) const override; |
| 107 void SendServerConfigUpdate( | 108 void SendServerConfigUpdate( |
| 108 const CachedNetworkParameters* cached_network_params) override; | 109 const CachedNetworkParameters* cached_network_params) override; |
| 109 uint8_t NumHandshakeMessages() const override; | 110 uint8_t NumHandshakeMessages() const override; |
| 110 uint8_t NumHandshakeMessagesWithServerNonces() const override; | 111 uint8_t NumHandshakeMessagesWithServerNonces() const override; |
| 111 int NumServerConfigUpdateMessagesSent() const override; | 112 int NumServerConfigUpdateMessagesSent() const override; |
| 112 const CachedNetworkParameters* PreviousCachedNetworkParams() const override; | 113 const CachedNetworkParameters* PreviousCachedNetworkParams() const override; |
| 113 bool UseStatelessRejectsIfPeerSupported() const override; | 114 bool UseStatelessRejectsIfPeerSupported() const override; |
| 114 bool PeerSupportsStatelessRejects() const override; | 115 bool PeerSupportsStatelessRejects() const override; |
| 116 bool ZeroRttAttempted() const override; |
| 115 void SetPeerSupportsStatelessRejects( | 117 void SetPeerSupportsStatelessRejects( |
| 116 bool peer_supports_stateless_rejects) override; | 118 bool peer_supports_stateless_rejects) override; |
| 117 void SetPreviousCachedNetworkParams( | 119 void SetPreviousCachedNetworkParams( |
| 118 CachedNetworkParameters cached_network_params) override; | 120 CachedNetworkParameters cached_network_params) override; |
| 119 | 121 |
| 120 // NOTE: Indicating that the Expect-CT header should be sent here presents | 122 // NOTE: Indicating that the Expect-CT header should be sent here presents |
| 121 // a layering violation to some extent. The Expect-CT header only applies to | 123 // a layering violation to some extent. The Expect-CT header only applies to |
| 122 // HTTP connections, while this class can be used for non-HTTP applications. | 124 // HTTP connections, while this class can be used for non-HTTP applications. |
| 123 // However, it is exposed here because that is the only place where the | 125 // However, it is exposed here because that is the only place where the |
| 124 // configuration for the certificate used in the connection is accessible. | 126 // configuration for the certificate used in the connection is accessible. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // client supports them, as indicated by | 258 // client supports them, as indicated by |
| 257 // peer_supports_stateless_rejects_. | 259 // peer_supports_stateless_rejects_. |
| 258 bool use_stateless_rejects_if_peer_supported_; | 260 bool use_stateless_rejects_if_peer_supported_; |
| 259 | 261 |
| 260 // Set to true, once the server has received information from the | 262 // Set to true, once the server has received information from the |
| 261 // client that it supports stateless reject. | 263 // client that it supports stateless reject. |
| 262 // TODO(jokulik): Remove once client stateless reject support | 264 // TODO(jokulik): Remove once client stateless reject support |
| 263 // becomes the default. | 265 // becomes the default. |
| 264 bool peer_supports_stateless_rejects_; | 266 bool peer_supports_stateless_rejects_; |
| 265 | 267 |
| 268 // True if client attempts 0-rtt handshake (which can succeed or fail). If |
| 269 // stateless rejects are used, this variable will be false for the stateless |
| 270 // rejected connection and true for subsequent connections. |
| 271 bool zero_rtt_attempted_; |
| 272 |
| 266 // Size of the packet containing the most recently received CHLO. | 273 // Size of the packet containing the most recently received CHLO. |
| 267 QuicByteCount chlo_packet_size_; | 274 QuicByteCount chlo_packet_size_; |
| 268 | 275 |
| 269 // Pointer to the active callback that will receive the result of the client | 276 // Pointer to the active callback that will receive the result of the client |
| 270 // hello validation request and forward it to FinishProcessingHandshakeMessage | 277 // hello validation request and forward it to FinishProcessingHandshakeMessage |
| 271 // for processing. nullptr if no handshake message is being validated. Note | 278 // for processing. nullptr if no handshake message is being validated. Note |
| 272 // that this field is mutually exclusive with process_client_hello_cb_. | 279 // that this field is mutually exclusive with process_client_hello_cb_. |
| 273 ValidateCallback* validate_client_hello_cb_; | 280 ValidateCallback* validate_client_hello_cb_; |
| 274 | 281 |
| 275 // Pointer to the active callback which will receive the results of | 282 // Pointer to the active callback which will receive the results of |
| 276 // ProcessClientHello and forward it to | 283 // ProcessClientHello and forward it to |
| 277 // FinishProcessingHandshakeMessageAfterProcessClientHello. Note that this | 284 // FinishProcessingHandshakeMessageAfterProcessClientHello. Note that this |
| 278 // field is mutually exclusive with validate_client_hello_cb_. | 285 // field is mutually exclusive with validate_client_hello_cb_. |
| 279 ProcessClientHelloCallback* process_client_hello_cb_; | 286 ProcessClientHelloCallback* process_client_hello_cb_; |
| 280 | 287 |
| 281 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream); | 288 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream); |
| 282 }; | 289 }; |
| 283 | 290 |
| 284 } // namespace net | 291 } // namespace net |
| 285 | 292 |
| 286 #endif // NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ | 293 #endif // NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ |
| OLD | NEW |