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

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

Issue 2876443002: Allow customization of client address used to generate and validate source address token (Closed)
Patch Set: Created 3 years, 7 months 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/core/quic_crypto_server_stream.h ('k') | net/quic/core/quic_flags_list.h » ('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/core/quic_crypto_server_stream.h" 5 #include "net/quic/core/quic_crypto_server_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "net/quic/core/crypto/crypto_protocol.h" 9 #include "net/quic/core/crypto/crypto_protocol.h"
10 #include "net/quic/core/crypto/crypto_utils.h" 10 #include "net/quic/core/crypto/crypto_utils.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 CryptoUtils::HashHandshakeMessage(message, &chlo_hash_, 156 CryptoUtils::HashHandshakeMessage(message, &chlo_hash_,
157 Perspective::IS_SERVER); 157 Perspective::IS_SERVER);
158 158
159 std::unique_ptr<ValidateCallback> cb(new ValidateCallback(this)); 159 std::unique_ptr<ValidateCallback> cb(new ValidateCallback(this));
160 DCHECK(validate_client_hello_cb_ == nullptr); 160 DCHECK(validate_client_hello_cb_ == nullptr);
161 DCHECK(process_client_hello_cb_ == nullptr); 161 DCHECK(process_client_hello_cb_ == nullptr);
162 validate_client_hello_cb_ = cb.get(); 162 validate_client_hello_cb_ = cb.get();
163 crypto_config_->ValidateClientHello( 163 crypto_config_->ValidateClientHello(
164 message, session()->connection()->peer_address().host(), 164 message, GetClientAddress().host(),
165 session()->connection()->self_address(), version(), 165 session()->connection()->self_address(), version(),
166 session()->connection()->clock(), signed_config_, std::move(cb)); 166 session()->connection()->clock(), signed_config_, std::move(cb));
167 } 167 }
168 168
169 void QuicCryptoServerStream::FinishProcessingHandshakeMessage( 169 void QuicCryptoServerStream::FinishProcessingHandshakeMessage(
170 QuicReferenceCountedPointer<ValidateClientHelloResultCallback::Result> 170 QuicReferenceCountedPointer<ValidateClientHelloResultCallback::Result>
171 result, 171 result,
172 std::unique_ptr<ProofSource::Details> details) { 172 std::unique_ptr<ProofSource::Details> details) {
173 const CryptoHandshakeMessage& message = result->client_hello; 173 const CryptoHandshakeMessage& message = result->client_hello;
174 174
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 return; 293 return;
294 } 294 }
295 295
296 std::unique_ptr<SendServerConfigUpdateCallback> cb( 296 std::unique_ptr<SendServerConfigUpdateCallback> cb(
297 new SendServerConfigUpdateCallback(this)); 297 new SendServerConfigUpdateCallback(this));
298 send_server_config_update_cb_ = cb.get(); 298 send_server_config_update_cb_ = cb.get();
299 299
300 crypto_config_->BuildServerConfigUpdateMessage( 300 crypto_config_->BuildServerConfigUpdateMessage(
301 session()->connection()->version(), chlo_hash_, 301 session()->connection()->version(), chlo_hash_,
302 previous_source_address_tokens_, session()->connection()->self_address(), 302 previous_source_address_tokens_, session()->connection()->self_address(),
303 session()->connection()->peer_address().host(), 303 GetClientAddress().host(), session()->connection()->clock(),
304 session()->connection()->clock(),
305 session()->connection()->random_generator(), compressed_certs_cache_, 304 session()->connection()->random_generator(), compressed_certs_cache_,
306 *crypto_negotiated_params_, cached_network_params, 305 *crypto_negotiated_params_, cached_network_params,
307 (session()->config()->HasReceivedConnectionOptions() 306 (session()->config()->HasReceivedConnectionOptions()
308 ? session()->config()->ReceivedConnectionOptions() 307 ? session()->config()->ReceivedConnectionOptions()
309 : QuicTagVector()), 308 : QuicTagVector()),
310 std::move(cb)); 309 std::move(cb));
311 } 310 }
312 311
313 QuicCryptoServerStream::SendServerConfigUpdateCallback:: 312 QuicCryptoServerStream::SendServerConfigUpdateCallback::
314 SendServerConfigUpdateCallback(QuicCryptoServerStream* parent) 313 SendServerConfigUpdateCallback(QuicCryptoServerStream* parent)
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 previous_source_address_tokens_ = result->info.source_address_tokens; 425 previous_source_address_tokens_ = result->info.source_address_tokens;
427 426
428 const bool use_stateless_rejects_in_crypto_config = 427 const bool use_stateless_rejects_in_crypto_config =
429 use_stateless_rejects_if_peer_supported_ && 428 use_stateless_rejects_if_peer_supported_ &&
430 peer_supports_stateless_rejects_; 429 peer_supports_stateless_rejects_;
431 QuicConnection* connection = session()->connection(); 430 QuicConnection* connection = session()->connection();
432 const QuicConnectionId server_designated_connection_id = 431 const QuicConnectionId server_designated_connection_id =
433 GenerateConnectionIdForReject(use_stateless_rejects_in_crypto_config); 432 GenerateConnectionIdForReject(use_stateless_rejects_in_crypto_config);
434 crypto_config_->ProcessClientHello( 433 crypto_config_->ProcessClientHello(
435 result, /*reject_only=*/false, connection->connection_id(), 434 result, /*reject_only=*/false, connection->connection_id(),
436 connection->self_address(), connection->peer_address(), version(), 435 connection->self_address(), GetClientAddress(), version(),
437 connection->supported_versions(), use_stateless_rejects_in_crypto_config, 436 connection->supported_versions(), use_stateless_rejects_in_crypto_config,
438 server_designated_connection_id, connection->clock(), 437 server_designated_connection_id, connection->clock(),
439 connection->random_generator(), compressed_certs_cache_, 438 connection->random_generator(), compressed_certs_cache_,
440 crypto_negotiated_params_, signed_config_, 439 crypto_negotiated_params_, signed_config_,
441 QuicCryptoStream::CryptoMessageFramingOverhead(version()), 440 QuicCryptoStream::CryptoMessageFramingOverhead(version()),
442 chlo_packet_size_, std::move(done_cb)); 441 chlo_packet_size_, std::move(done_cb));
443 } 442 }
444 443
445 void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) {} 444 void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) {}
446 445
(...skipping 16 matching lines...) Expand all
463 462
464 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject( 463 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject(
465 bool use_stateless_rejects) { 464 bool use_stateless_rejects) {
466 if (!use_stateless_rejects) { 465 if (!use_stateless_rejects) {
467 return 0; 466 return 0;
468 } 467 }
469 return helper_->GenerateConnectionIdForReject( 468 return helper_->GenerateConnectionIdForReject(
470 session()->connection()->connection_id()); 469 session()->connection()->connection_id());
471 } 470 }
472 471
472 const QuicSocketAddress QuicCryptoServerStream::GetClientAddress() {
473 return session()->connection()->peer_address();
474 }
475
473 } // namespace net 476 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_crypto_server_stream.h ('k') | net/quic/core/quic_flags_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698