| 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/core/crypto/quic_crypto_server_config.h" | 5 #include "net/quic/core/crypto/quic_crypto_server_config.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "net/quic/core/crypto/quic_decrypter.h" | 28 #include "net/quic/core/crypto/quic_decrypter.h" |
| 29 #include "net/quic/core/crypto/quic_encrypter.h" | 29 #include "net/quic/core/crypto/quic_encrypter.h" |
| 30 #include "net/quic/core/crypto/quic_random.h" | 30 #include "net/quic/core/crypto/quic_random.h" |
| 31 #include "net/quic/core/proto/source_address_token.pb.h" | 31 #include "net/quic/core/proto/source_address_token.pb.h" |
| 32 #include "net/quic/core/quic_flags.h" | 32 #include "net/quic/core/quic_flags.h" |
| 33 #include "net/quic/core/quic_packets.h" | 33 #include "net/quic/core/quic_packets.h" |
| 34 #include "net/quic/core/quic_socket_address_coder.h" | 34 #include "net/quic/core/quic_socket_address_coder.h" |
| 35 #include "net/quic/core/quic_utils.h" | 35 #include "net/quic/core/quic_utils.h" |
| 36 #include "net/quic/platform/api/quic_bug_tracker.h" | 36 #include "net/quic/platform/api/quic_bug_tracker.h" |
| 37 #include "net/quic/platform/api/quic_clock.h" | 37 #include "net/quic/platform/api/quic_clock.h" |
| 38 #include "net/quic/platform/api/quic_endian.h" |
| 38 #include "net/quic/platform/api/quic_hostname_utils.h" | 39 #include "net/quic/platform/api/quic_hostname_utils.h" |
| 39 #include "net/quic/platform/api/quic_logging.h" | 40 #include "net/quic/platform/api/quic_logging.h" |
| 40 #include "net/quic/platform/api/quic_reference_counted.h" | 41 #include "net/quic/platform/api/quic_reference_counted.h" |
| 41 #include "net/quic/platform/api/quic_text_utils.h" | 42 #include "net/quic/platform/api/quic_text_utils.h" |
| 42 #include "third_party/boringssl/src/include/openssl/sha.h" | 43 #include "third_party/boringssl/src/include/openssl/sha.h" |
| 43 | 44 |
| 44 using std::string; | 45 using std::string; |
| 45 | 46 |
| 46 namespace net { | 47 namespace net { |
| 47 | 48 |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 const QuicClock* clock, | 739 const QuicClock* clock, |
| 739 QuicRandom* rand, | 740 QuicRandom* rand, |
| 740 QuicCompressedCertsCache* compressed_certs_cache, | 741 QuicCompressedCertsCache* compressed_certs_cache, |
| 741 QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params, | 742 QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params, |
| 742 QuicReferenceCountedPointer<QuicSignedServerConfig> signed_config, | 743 QuicReferenceCountedPointer<QuicSignedServerConfig> signed_config, |
| 743 QuicByteCount total_framing_overhead, | 744 QuicByteCount total_framing_overhead, |
| 744 QuicByteCount chlo_packet_size, | 745 QuicByteCount chlo_packet_size, |
| 745 const QuicReferenceCountedPointer<Config>& requested_config, | 746 const QuicReferenceCountedPointer<Config>& requested_config, |
| 746 const QuicReferenceCountedPointer<Config>& primary_config, | 747 const QuicReferenceCountedPointer<Config>& primary_config, |
| 747 std::unique_ptr<ProcessClientHelloResultCallback> done_cb) const { | 748 std::unique_ptr<ProcessClientHelloResultCallback> done_cb) const { |
| 749 if (QuicUtils::IsConnectionIdWireFormatBigEndian(Perspective::IS_SERVER)) { |
| 750 connection_id = QuicEndian::HostToNet64(connection_id); |
| 751 } |
| 752 |
| 748 ProcessClientHelloHelper helper(&done_cb); | 753 ProcessClientHelloHelper helper(&done_cb); |
| 749 | 754 |
| 750 if (found_error) { | 755 if (found_error) { |
| 751 helper.Fail(QUIC_HANDSHAKE_FAILED, "Failed to get proof"); | 756 helper.Fail(QUIC_HANDSHAKE_FAILED, "Failed to get proof"); |
| 752 return; | 757 return; |
| 753 } | 758 } |
| 754 | 759 |
| 755 const CryptoHandshakeMessage& client_hello = | 760 const CryptoHandshakeMessage& client_hello = |
| 756 validate_chlo_result.client_hello; | 761 validate_chlo_result.client_hello; |
| 757 const ClientHelloInfo& info = validate_chlo_result.info; | 762 const ClientHelloInfo& info = validate_chlo_result.info; |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 const QuicSignedServerConfig& signed_config, | 1477 const QuicSignedServerConfig& signed_config, |
| 1473 QuicByteCount total_framing_overhead, | 1478 QuicByteCount total_framing_overhead, |
| 1474 QuicByteCount chlo_packet_size, | 1479 QuicByteCount chlo_packet_size, |
| 1475 CryptoHandshakeMessage* out) const { | 1480 CryptoHandshakeMessage* out) const { |
| 1476 if (FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support && | 1481 if (FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support && |
| 1477 use_stateless_rejects) { | 1482 use_stateless_rejects) { |
| 1478 QUIC_DVLOG(1) << "QUIC Crypto server config returning stateless reject " | 1483 QUIC_DVLOG(1) << "QUIC Crypto server config returning stateless reject " |
| 1479 << "with server-designated connection ID " | 1484 << "with server-designated connection ID " |
| 1480 << server_designated_connection_id; | 1485 << server_designated_connection_id; |
| 1481 out->set_tag(kSREJ); | 1486 out->set_tag(kSREJ); |
| 1487 if (QuicUtils::IsConnectionIdWireFormatBigEndian(Perspective::IS_SERVER)) { |
| 1488 server_designated_connection_id = |
| 1489 QuicEndian::HostToNet64(server_designated_connection_id); |
| 1490 } |
| 1482 out->SetValue(kRCID, server_designated_connection_id); | 1491 out->SetValue(kRCID, server_designated_connection_id); |
| 1483 } else { | 1492 } else { |
| 1484 out->set_tag(kREJ); | 1493 out->set_tag(kREJ); |
| 1485 } | 1494 } |
| 1486 out->SetStringPiece(kSCFG, config.serialized); | 1495 out->SetStringPiece(kSCFG, config.serialized); |
| 1487 out->SetStringPiece( | 1496 out->SetStringPiece( |
| 1488 kSourceAddressTokenTag, | 1497 kSourceAddressTokenTag, |
| 1489 NewSourceAddressToken(config, info.source_address_tokens, info.client_ip, | 1498 NewSourceAddressToken(config, info.source_address_tokens, info.client_ip, |
| 1490 rand, info.now, &cached_network_params)); | 1499 rand, info.now, &cached_network_params)); |
| 1491 out->SetValue(kSTTL, config.expiry_time.AbsoluteDifference(now).ToSeconds()); | 1500 out->SetValue(kSTTL, config.expiry_time.AbsoluteDifference(now).ToSeconds()); |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1956 expiry_time(QuicWallTime::Zero()), | 1965 expiry_time(QuicWallTime::Zero()), |
| 1957 priority(0), | 1966 priority(0), |
| 1958 source_address_token_boxer(nullptr) {} | 1967 source_address_token_boxer(nullptr) {} |
| 1959 | 1968 |
| 1960 QuicCryptoServerConfig::Config::~Config() {} | 1969 QuicCryptoServerConfig::Config::~Config() {} |
| 1961 | 1970 |
| 1962 QuicSignedServerConfig::QuicSignedServerConfig() {} | 1971 QuicSignedServerConfig::QuicSignedServerConfig() {} |
| 1963 QuicSignedServerConfig::~QuicSignedServerConfig() {} | 1972 QuicSignedServerConfig::~QuicSignedServerConfig() {} |
| 1964 | 1973 |
| 1965 } // namespace net | 1974 } // namespace net |
| OLD | NEW |