OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/crypto/quic_crypto_server_config.h" | 5 #include "net/quic/crypto/quic_crypto_server_config.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 done_cb->Run(result); | 483 done_cb->Run(result); |
484 } | 484 } |
485 } | 485 } |
486 | 486 |
487 QuicErrorCode QuicCryptoServerConfig::ProcessClientHello( | 487 QuicErrorCode QuicCryptoServerConfig::ProcessClientHello( |
488 const ValidateClientHelloResultCallback::Result& validate_chlo_result, | 488 const ValidateClientHelloResultCallback::Result& validate_chlo_result, |
489 QuicConnectionId connection_id, | 489 QuicConnectionId connection_id, |
490 IPEndPoint client_address, | 490 IPEndPoint client_address, |
491 QuicVersion version, | 491 QuicVersion version, |
492 const QuicVersionVector& supported_versions, | 492 const QuicVersionVector& supported_versions, |
493 uint32 initial_flow_control_window_bytes, | |
494 const QuicClock* clock, | 493 const QuicClock* clock, |
495 QuicRandom* rand, | 494 QuicRandom* rand, |
496 QuicCryptoNegotiatedParameters *params, | 495 QuicCryptoNegotiatedParameters *params, |
497 CryptoHandshakeMessage* out, | 496 CryptoHandshakeMessage* out, |
498 string* error_details) const { | 497 string* error_details) const { |
499 DCHECK(error_details); | 498 DCHECK(error_details); |
500 | 499 |
501 const CryptoHandshakeMessage& client_hello = | 500 const CryptoHandshakeMessage& client_hello = |
502 validate_chlo_result.client_hello; | 501 validate_chlo_result.client_hello; |
503 const ClientHelloInfo& info = validate_chlo_result.info; | 502 const ClientHelloInfo& info = validate_chlo_result.info; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 out->SetVector(kVER, supported_version_tags); | 731 out->SetVector(kVER, supported_version_tags); |
733 out->SetStringPiece(kSourceAddressTokenTag, | 732 out->SetStringPiece(kSourceAddressTokenTag, |
734 NewSourceAddressToken( | 733 NewSourceAddressToken( |
735 *requested_config, | 734 *requested_config, |
736 client_address, rand, | 735 client_address, rand, |
737 info.now)); | 736 info.now)); |
738 QuicSocketAddressCoder address_coder(client_address); | 737 QuicSocketAddressCoder address_coder(client_address); |
739 out->SetStringPiece(kCADR, address_coder.Encode()); | 738 out->SetStringPiece(kCADR, address_coder.Encode()); |
740 out->SetStringPiece(kPUBS, forward_secure_public_value); | 739 out->SetStringPiece(kPUBS, forward_secure_public_value); |
741 | 740 |
742 // Set initial receive window for flow control. | |
743 out->SetValue(kIFCW, initial_flow_control_window_bytes); | |
744 | |
745 return QUIC_NO_ERROR; | 741 return QUIC_NO_ERROR; |
746 } | 742 } |
747 | 743 |
748 scoped_refptr<QuicCryptoServerConfig::Config> | 744 scoped_refptr<QuicCryptoServerConfig::Config> |
749 QuicCryptoServerConfig::GetConfigWithScid(StringPiece requested_scid) const { | 745 QuicCryptoServerConfig::GetConfigWithScid(StringPiece requested_scid) const { |
750 // In Chromium, we will dead lock if the lock is held by the current thread. | 746 // In Chromium, we will dead lock if the lock is held by the current thread. |
751 // Chromium doesn't have AssertReaderHeld API call. | 747 // Chromium doesn't have AssertReaderHeld API call. |
752 // configs_lock_.AssertReaderHeld(); | 748 // configs_lock_.AssertReaderHeld(); |
753 | 749 |
754 if (!requested_scid.empty()) { | 750 if (!requested_scid.empty()) { |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 QuicCryptoServerConfig::Config::Config() | 1400 QuicCryptoServerConfig::Config::Config() |
1405 : channel_id_enabled(false), | 1401 : channel_id_enabled(false), |
1406 is_primary(false), | 1402 is_primary(false), |
1407 primary_time(QuicWallTime::Zero()), | 1403 primary_time(QuicWallTime::Zero()), |
1408 priority(0), | 1404 priority(0), |
1409 source_address_token_boxer(NULL) {} | 1405 source_address_token_boxer(NULL) {} |
1410 | 1406 |
1411 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } | 1407 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } |
1412 | 1408 |
1413 } // namespace net | 1409 } // namespace net |
OLD | NEW |