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 #include "net/quic/quic_crypto_server_stream.h" | 5 #include "net/quic/quic_crypto_server_stream.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "crypto/secure_hash.h" | 8 #include "crypto/secure_hash.h" |
9 #include "net/quic/crypto/crypto_protocol.h" | 9 #include "net/quic/crypto/crypto_protocol.h" |
10 #include "net/quic/crypto/crypto_utils.h" | 10 #include "net/quic/crypto/crypto_utils.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 const QuicData& data = server_config_update_message.GetSerialized(); | 182 const QuicData& data = server_config_update_message.GetSerialized(); |
183 WriteOrBufferData(string(data.data(), data.length()), false, nullptr); | 183 WriteOrBufferData(string(data.data(), data.length()), false, nullptr); |
184 | 184 |
185 ++num_server_config_update_messages_sent_; | 185 ++num_server_config_update_messages_sent_; |
186 } | 186 } |
187 | 187 |
188 void QuicCryptoServerStream::OnServerHelloAcked() { | 188 void QuicCryptoServerStream::OnServerHelloAcked() { |
189 session()->connection()->OnHandshakeComplete(); | 189 session()->connection()->OnHandshakeComplete(); |
190 } | 190 } |
191 | 191 |
| 192 void QuicCryptoServerStream::set_previous_cached_network_params( |
| 193 CachedNetworkParameters cached_network_params) { |
| 194 previous_cached_network_params_.reset( |
| 195 new CachedNetworkParameters(cached_network_params)); |
| 196 } |
| 197 |
192 bool QuicCryptoServerStream::GetBase64SHA256ClientChannelID( | 198 bool QuicCryptoServerStream::GetBase64SHA256ClientChannelID( |
193 string* output) const { | 199 string* output) const { |
194 if (!encryption_established_ || | 200 if (!encryption_established_ || |
195 crypto_negotiated_params_.channel_id.empty()) { | 201 crypto_negotiated_params_.channel_id.empty()) { |
196 return false; | 202 return false; |
197 } | 203 } |
198 | 204 |
199 const string& channel_id(crypto_negotiated_params_.channel_id); | 205 const string& channel_id(crypto_negotiated_params_.channel_id); |
200 scoped_ptr<crypto::SecureHash> hash( | 206 scoped_ptr<crypto::SecureHash> hash( |
201 crypto::SecureHash::Create(crypto::SecureHash::SHA256)); | 207 crypto::SecureHash::Create(crypto::SecureHash::SHA256)); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 session()->connection()->version(), | 244 session()->connection()->version(), |
239 session()->connection()->supported_versions(), | 245 session()->connection()->supported_versions(), |
240 session()->connection()->clock(), | 246 session()->connection()->clock(), |
241 session()->connection()->random_generator(), | 247 session()->connection()->random_generator(), |
242 &crypto_negotiated_params_, reply, error_details); | 248 &crypto_negotiated_params_, reply, error_details); |
243 } | 249 } |
244 | 250 |
245 void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) { | 251 void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) { |
246 } | 252 } |
247 | 253 |
| 254 CachedNetworkParameters* |
| 255 QuicCryptoServerStream::get_previous_cached_network_params() { |
| 256 return previous_cached_network_params_.get(); |
| 257 } |
| 258 |
248 QuicCryptoServerStream::ValidateCallback::ValidateCallback( | 259 QuicCryptoServerStream::ValidateCallback::ValidateCallback( |
249 QuicCryptoServerStream* parent) : parent_(parent) { | 260 QuicCryptoServerStream* parent) : parent_(parent) { |
250 } | 261 } |
251 | 262 |
252 void QuicCryptoServerStream::ValidateCallback::Cancel() { parent_ = nullptr; } | 263 void QuicCryptoServerStream::ValidateCallback::Cancel() { parent_ = nullptr; } |
253 | 264 |
254 void QuicCryptoServerStream::ValidateCallback::RunImpl( | 265 void QuicCryptoServerStream::ValidateCallback::RunImpl( |
255 const CryptoHandshakeMessage& client_hello, | 266 const CryptoHandshakeMessage& client_hello, |
256 const Result& result) { | 267 const Result& result) { |
257 if (parent_ != nullptr) { | 268 if (parent_ != nullptr) { |
258 parent_->FinishProcessingHandshakeMessage(client_hello, result); | 269 parent_->FinishProcessingHandshakeMessage(client_hello, result); |
259 } | 270 } |
260 } | 271 } |
261 | 272 |
262 } // namespace net | 273 } // namespace net |
OLD | NEW |