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_client_stream.h" | 5 #include "net/quic/core/quic_crypto_client_stream.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 << ") has no room for framing overhead."; | 335 << ") has no room for framing overhead."; |
336 CloseConnectionWithDetails(QUIC_INTERNAL_ERROR, | 336 CloseConnectionWithDetails(QUIC_INTERNAL_ERROR, |
337 "max_packet_size too smalll"); | 337 "max_packet_size too smalll"); |
338 return; | 338 return; |
339 } | 339 } |
340 if (kClientHelloMinimumSize > max_packet_size - kFramingOverhead) { | 340 if (kClientHelloMinimumSize > max_packet_size - kFramingOverhead) { |
341 DLOG(DFATAL) << "Client hello won't fit in a single packet."; | 341 DLOG(DFATAL) << "Client hello won't fit in a single packet."; |
342 CloseConnectionWithDetails(QUIC_INTERNAL_ERROR, "CHLO too large"); | 342 CloseConnectionWithDetails(QUIC_INTERNAL_ERROR, "CHLO too large"); |
343 return; | 343 return; |
344 } | 344 } |
| 345 // TODO(rch): Remove this when we remove: |
| 346 // FLAGS_quic_use_chlo_packet_size |
345 out.set_minimum_size( | 347 out.set_minimum_size( |
346 static_cast<size_t>(max_packet_size - kFramingOverhead)); | 348 static_cast<size_t>(max_packet_size - kFramingOverhead)); |
347 next_state_ = STATE_RECV_REJ; | 349 next_state_ = STATE_RECV_REJ; |
348 CryptoUtils::HashHandshakeMessage(out, &chlo_hash_); | 350 CryptoUtils::HashHandshakeMessage(out, &chlo_hash_); |
349 SendHandshakeMessage(out); | 351 SendHandshakeMessage(out); |
350 return; | 352 return; |
351 } | 353 } |
352 | 354 |
353 // If the server nonce is empty, copy over the server nonce from a previous | 355 // If the server nonce is empty, copy over the server nonce from a previous |
354 // SREJ, if there is one. | 356 // SREJ, if there is one. |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 } | 692 } |
691 for (size_t i = 0; i < num_their_proof_demands; i++) { | 693 for (size_t i = 0; i < num_their_proof_demands; i++) { |
692 if (their_proof_demands[i] == kCHID) { | 694 if (their_proof_demands[i] == kCHID) { |
693 return true; | 695 return true; |
694 } | 696 } |
695 } | 697 } |
696 return false; | 698 return false; |
697 } | 699 } |
698 | 700 |
699 } // namespace net | 701 } // namespace net |
OLD | NEW |