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 <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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 } | 421 } |
422 | 422 |
423 QuicErrorCode QuicCryptoServerStream::ProcessClientHello( | 423 QuicErrorCode QuicCryptoServerStream::ProcessClientHello( |
424 const CryptoHandshakeMessage& message, | 424 const CryptoHandshakeMessage& message, |
425 const ValidateClientHelloResultCallback::Result& result, | 425 const ValidateClientHelloResultCallback::Result& result, |
426 CryptoHandshakeMessage* reply, | 426 CryptoHandshakeMessage* reply, |
427 DiversificationNonce* out_diversification_nonce, | 427 DiversificationNonce* out_diversification_nonce, |
428 string* error_details) { | 428 string* error_details) { |
429 QuicServerSessionBase* session_base = | 429 QuicServerSessionBase* session_base = |
430 static_cast<QuicServerSessionBase*>(session()); | 430 static_cast<QuicServerSessionBase*>(session()); |
431 if (FLAGS_quic_enable_chlo_policy && | 431 if (!session_base->CanAcceptClientHello(message, error_details)) { |
432 !session_base->CanAcceptClientHello(message, error_details)) { | |
433 return QUIC_HANDSHAKE_FAILED; | 432 return QUIC_HANDSHAKE_FAILED; |
434 } | 433 } |
435 | 434 |
436 if (!result.info.server_nonce.empty()) { | 435 if (!result.info.server_nonce.empty()) { |
437 ++num_handshake_messages_with_server_nonces_; | 436 ++num_handshake_messages_with_server_nonces_; |
438 } | 437 } |
439 // Store the bandwidth estimate from the client. | 438 // Store the bandwidth estimate from the client. |
440 if (result.cached_network_params.bandwidth_estimate_bytes_per_second() > 0) { | 439 if (result.cached_network_params.bandwidth_estimate_bytes_per_second() > 0) { |
441 previous_cached_network_params_.reset( | 440 previous_cached_network_params_.reset( |
442 new CachedNetworkParameters(result.cached_network_params)); | 441 new CachedNetworkParameters(result.cached_network_params)); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject( | 481 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject( |
483 QuicConnectionId connection_id) { | 482 QuicConnectionId connection_id) { |
484 // TODO(rch): Remove this method when | 483 // TODO(rch): Remove this method when |
485 // reloadable_flag_quic_dispatcher_creates_id2 is removed. | 484 // reloadable_flag_quic_dispatcher_creates_id2 is removed. |
486 QuicServerSessionBase* session_base = | 485 QuicServerSessionBase* session_base = |
487 static_cast<QuicServerSessionBase*>(session()); | 486 static_cast<QuicServerSessionBase*>(session()); |
488 return session_base->GenerateConnectionIdForReject(connection_id); | 487 return session_base->GenerateConnectionIdForReject(connection_id); |
489 } | 488 } |
490 | 489 |
491 } // namespace net | 490 } // namespace net |
OLD | NEW |