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_QUIC_CRYPTO_SERVER_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_ |
6 #define NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_ | 6 #define NET_QUIC_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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const ValidateClientHelloResultCallback::Result& result, | 107 const ValidateClientHelloResultCallback::Result& result, |
108 std::unique_ptr<ProofSource::Details> proof_source_details, | 108 std::unique_ptr<ProofSource::Details> proof_source_details, |
109 CryptoHandshakeMessage* reply, | 109 CryptoHandshakeMessage* reply, |
110 DiversificationNonce* out_diversification_nonce, | 110 DiversificationNonce* out_diversification_nonce, |
111 std::string* error_details); | 111 std::string* error_details); |
112 | 112 |
113 // Hook that allows the server to set QuicConfig defaults just | 113 // Hook that allows the server to set QuicConfig defaults just |
114 // before going through the parameter negotiation step. | 114 // before going through the parameter negotiation step. |
115 virtual void OverrideQuicConfigDefaults(QuicConfig* config); | 115 virtual void OverrideQuicConfigDefaults(QuicConfig* config); |
116 | 116 |
117 // Given the current connection_id, generates a new ConnectionId to | |
118 // be returned with a stateless reject. | |
119 virtual QuicConnectionId GenerateConnectionIdForReject( | |
120 QuicConnectionId connection_id); | |
121 | |
122 private: | 117 private: |
123 friend class test::CryptoTestUtils; | 118 friend class test::CryptoTestUtils; |
124 friend class test::QuicCryptoServerStreamPeer; | 119 friend class test::QuicCryptoServerStreamPeer; |
125 | 120 |
126 class ValidateCallback : public ValidateClientHelloResultCallback { | 121 class ValidateCallback : public ValidateClientHelloResultCallback { |
127 public: | 122 public: |
128 explicit ValidateCallback(QuicCryptoServerStream* parent); | 123 explicit ValidateCallback(QuicCryptoServerStream* parent); |
129 // To allow the parent to detach itself from the callback before deletion. | 124 // To allow the parent to detach itself from the callback before deletion. |
130 void Cancel(); | 125 void Cancel(); |
131 | 126 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 const ValidateClientHelloResultCallback::Result& result, | 161 const ValidateClientHelloResultCallback::Result& result, |
167 std::unique_ptr<ProofSource::Details> details); | 162 std::unique_ptr<ProofSource::Details> details); |
168 | 163 |
169 // Invoked by SendServerConfigUpdateCallback::RunImpl once the proof has been | 164 // Invoked by SendServerConfigUpdateCallback::RunImpl once the proof has been |
170 // received. |ok| indicates whether or not the proof was successfully | 165 // received. |ok| indicates whether or not the proof was successfully |
171 // acquired, and |message| holds the partially-constructed message from | 166 // acquired, and |message| holds the partially-constructed message from |
172 // SendServerConfigUpdate. | 167 // SendServerConfigUpdate. |
173 void FinishSendServerConfigUpdate(bool ok, | 168 void FinishSendServerConfigUpdate(bool ok, |
174 const CryptoHandshakeMessage& message); | 169 const CryptoHandshakeMessage& message); |
175 | 170 |
| 171 // Returns a new ConnectionId to be used for statelessly rejected connections |
| 172 // if |use_stateless_rejects| is true. Returns 0 otherwise. |
| 173 QuicConnectionId GenerateConnectionIdForReject(bool use_stateless_rejects); |
| 174 |
176 // crypto_config_ contains crypto parameters for the handshake. | 175 // crypto_config_ contains crypto parameters for the handshake. |
177 const QuicCryptoServerConfig* crypto_config_; | 176 const QuicCryptoServerConfig* crypto_config_; |
178 | 177 |
179 // compressed_certs_cache_ contains a set of most recently compressed certs. | 178 // compressed_certs_cache_ contains a set of most recently compressed certs. |
180 // Owned by QuicDispatcher. | 179 // Owned by QuicDispatcher. |
181 QuicCompressedCertsCache* compressed_certs_cache_; | 180 QuicCompressedCertsCache* compressed_certs_cache_; |
182 | 181 |
183 // Server's certificate chain and signature of the server config, as provided | 182 // Server's certificate chain and signature of the server config, as provided |
184 // by ProofSource::GetProof. | 183 // by ProofSource::GetProof. |
185 QuicCryptoProof crypto_proof_; | 184 QuicCryptoProof crypto_proof_; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 231 |
233 // Size of the packet containing the most recently received CHLO. | 232 // Size of the packet containing the most recently received CHLO. |
234 QuicByteCount chlo_packet_size_; | 233 QuicByteCount chlo_packet_size_; |
235 | 234 |
236 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream); | 235 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream); |
237 }; | 236 }; |
238 | 237 |
239 } // namespace net | 238 } // namespace net |
240 | 239 |
241 #endif // NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_ | 240 #endif // NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_ |
OLD | NEW |