Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: net/quic/quic_crypto_server_stream.cc

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_data_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/cached_network_parameters.h" 9 #include "net/quic/crypto/cached_network_parameters.h"
10 #include "net/quic/crypto/crypto_protocol.h" 10 #include "net/quic/crypto/crypto_protocol.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 void QuicCryptoServerStream::SendServerConfigUpdate( 158 void QuicCryptoServerStream::SendServerConfigUpdate(
159 const CachedNetworkParameters* cached_network_params) { 159 const CachedNetworkParameters* cached_network_params) {
160 if (session()->connection()->version() <= QUIC_VERSION_21 || 160 if (session()->connection()->version() <= QUIC_VERSION_21 ||
161 !handshake_confirmed_) { 161 !handshake_confirmed_) {
162 return; 162 return;
163 } 163 }
164 164
165 CryptoHandshakeMessage server_config_update_message; 165 CryptoHandshakeMessage server_config_update_message;
166 if (!crypto_config_.BuildServerConfigUpdateMessage( 166 if (!crypto_config_.BuildServerConfigUpdateMessage(
167 session()->connection()->self_address(),
167 session()->connection()->peer_address(), 168 session()->connection()->peer_address(),
168 session()->connection()->clock(), 169 session()->connection()->clock(),
169 session()->connection()->random_generator(), 170 session()->connection()->random_generator(),
170 crypto_negotiated_params_, 171 crypto_negotiated_params_, cached_network_params,
171 cached_network_params,
172 &server_config_update_message)) { 172 &server_config_update_message)) {
173 DVLOG(1) << "Server: Failed to build server config update (SCUP)!"; 173 DVLOG(1) << "Server: Failed to build server config update (SCUP)!";
174 return; 174 return;
175 } 175 }
176 176
177 DVLOG(1) << "Server: Sending server config update: " 177 DVLOG(1) << "Server: Sending server config update: "
178 << server_config_update_message.DebugString(); 178 << server_config_update_message.DebugString();
179 const QuicData& data = server_config_update_message.GetSerialized(); 179 const QuicData& data = server_config_update_message.GetSerialized();
180 WriteOrBufferData(string(data.data(), data.length()), false, nullptr); 180 WriteOrBufferData(string(data.data(), data.length()), false, nullptr);
181 181
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 const ValidateClientHelloResultCallback::Result& result, 227 const ValidateClientHelloResultCallback::Result& result,
228 CryptoHandshakeMessage* reply, 228 CryptoHandshakeMessage* reply,
229 string* error_details) { 229 string* error_details) {
230 // Store the bandwidth estimate from the client. 230 // Store the bandwidth estimate from the client.
231 if (result.cached_network_params.bandwidth_estimate_bytes_per_second() > 0) { 231 if (result.cached_network_params.bandwidth_estimate_bytes_per_second() > 0) {
232 previous_cached_network_params_.reset( 232 previous_cached_network_params_.reset(
233 new CachedNetworkParameters(result.cached_network_params)); 233 new CachedNetworkParameters(result.cached_network_params));
234 } 234 }
235 235
236 return crypto_config_.ProcessClientHello( 236 return crypto_config_.ProcessClientHello(
237 result, 237 result, session()->connection()->connection_id(),
238 session()->connection()->connection_id(), 238 session()->connection()->self_address(),
239 session()->connection()->peer_address(), 239 session()->connection()->peer_address(),
240 session()->connection()->version(), 240 session()->connection()->version(),
241 session()->connection()->supported_versions(), 241 session()->connection()->supported_versions(),
242 session()->connection()->clock(), 242 session()->connection()->clock(),
243 session()->connection()->random_generator(), 243 session()->connection()->random_generator(), &crypto_negotiated_params_,
244 &crypto_negotiated_params_, reply, error_details); 244 reply, error_details);
245 } 245 }
246 246
247 void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) { 247 void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) {
248 } 248 }
249 249
250 const CachedNetworkParameters* 250 const CachedNetworkParameters*
251 QuicCryptoServerStream::previous_cached_network_params() const { 251 QuicCryptoServerStream::previous_cached_network_params() const {
252 return previous_cached_network_params_.get(); 252 return previous_cached_network_params_.get();
253 } 253 }
254 254
255 QuicCryptoServerStream::ValidateCallback::ValidateCallback( 255 QuicCryptoServerStream::ValidateCallback::ValidateCallback(
256 QuicCryptoServerStream* parent) : parent_(parent) { 256 QuicCryptoServerStream* parent) : parent_(parent) {
257 } 257 }
258 258
259 void QuicCryptoServerStream::ValidateCallback::Cancel() { parent_ = nullptr; } 259 void QuicCryptoServerStream::ValidateCallback::Cancel() { parent_ = nullptr; }
260 260
261 void QuicCryptoServerStream::ValidateCallback::RunImpl( 261 void QuicCryptoServerStream::ValidateCallback::RunImpl(
262 const CryptoHandshakeMessage& client_hello, 262 const CryptoHandshakeMessage& client_hello,
263 const Result& result) { 263 const Result& result) {
264 if (parent_ != nullptr) { 264 if (parent_ != nullptr) {
265 parent_->FinishProcessingHandshakeMessage(client_hello, result); 265 parent_->FinishProcessingHandshakeMessage(client_hello, result);
266 } 266 }
267 } 267 }
268 268
269 } // namespace net 269 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_data_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698