| 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/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 "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "crypto/secure_hash.h" | 10 #include "crypto/secure_hash.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 previous_cached_network_params_.reset( | 398 previous_cached_network_params_.reset( |
| 399 new CachedNetworkParameters(result.cached_network_params)); | 399 new CachedNetworkParameters(result.cached_network_params)); |
| 400 } | 400 } |
| 401 previous_source_address_tokens_ = result.info.source_address_tokens; | 401 previous_source_address_tokens_ = result.info.source_address_tokens; |
| 402 | 402 |
| 403 const bool use_stateless_rejects_in_crypto_config = | 403 const bool use_stateless_rejects_in_crypto_config = |
| 404 use_stateless_rejects_if_peer_supported_ && | 404 use_stateless_rejects_if_peer_supported_ && |
| 405 peer_supports_stateless_rejects_; | 405 peer_supports_stateless_rejects_; |
| 406 QuicConnection* connection = session()->connection(); | 406 QuicConnection* connection = session()->connection(); |
| 407 const QuicConnectionId server_designated_connection_id = | 407 const QuicConnectionId server_designated_connection_id = |
| 408 use_stateless_rejects_in_crypto_config | 408 GenerateConnectionIdForReject(use_stateless_rejects_in_crypto_config); |
| 409 ? GenerateConnectionIdForReject(connection->connection_id()) | |
| 410 : 0; | |
| 411 return crypto_config_->ProcessClientHello( | 409 return crypto_config_->ProcessClientHello( |
| 412 result, /*reject_only=*/false, connection->connection_id(), | 410 result, /*reject_only=*/false, connection->connection_id(), |
| 413 connection->self_address().address(), connection->peer_address(), | 411 connection->self_address().address(), connection->peer_address(), |
| 414 version(), connection->supported_versions(), | 412 version(), connection->supported_versions(), |
| 415 use_stateless_rejects_in_crypto_config, server_designated_connection_id, | 413 use_stateless_rejects_in_crypto_config, server_designated_connection_id, |
| 416 connection->clock(), connection->random_generator(), | 414 connection->clock(), connection->random_generator(), |
| 417 compressed_certs_cache_, &crypto_negotiated_params_, &crypto_proof_, | 415 compressed_certs_cache_, &crypto_negotiated_params_, &crypto_proof_, |
| 418 QuicCryptoStream::CryptoMessageFramingOverhead(version()), | 416 QuicCryptoStream::CryptoMessageFramingOverhead(version()), |
| 419 chlo_packet_size_, reply, out_diversification_nonce, error_details); | 417 chlo_packet_size_, reply, out_diversification_nonce, error_details); |
| 420 } | 418 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 433 const CryptoHandshakeMessage& client_hello, | 431 const CryptoHandshakeMessage& client_hello, |
| 434 const Result& result, | 432 const Result& result, |
| 435 std::unique_ptr<ProofSource::Details> details) { | 433 std::unique_ptr<ProofSource::Details> details) { |
| 436 if (parent_ != nullptr) { | 434 if (parent_ != nullptr) { |
| 437 parent_->FinishProcessingHandshakeMessage(client_hello, result, | 435 parent_->FinishProcessingHandshakeMessage(client_hello, result, |
| 438 std::move(details)); | 436 std::move(details)); |
| 439 } | 437 } |
| 440 } | 438 } |
| 441 | 439 |
| 442 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject( | 440 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject( |
| 443 QuicConnectionId connection_id) { | 441 bool use_stateless_rejects) { |
| 444 // TODO(rch): Remove this method when | 442 if (!use_stateless_rejects) { |
| 445 // reloadable_flag_quic_dispatcher_creates_id2 is removed. | 443 return 0; |
| 444 } |
| 446 QuicServerSessionBase* session_base = | 445 QuicServerSessionBase* session_base = |
| 447 static_cast<QuicServerSessionBase*>(session()); | 446 static_cast<QuicServerSessionBase*>(session()); |
| 448 return session_base->GenerateConnectionIdForReject(connection_id); | 447 return session_base->GenerateConnectionIdForReject( |
| 448 session()->connection()->connection_id()); |
| 449 } | 449 } |
| 450 | 450 |
| 451 } // namespace net | 451 } // namespace net |
| OLD | NEW |