Skip to content

Commit

Permalink
Landing Recent QUIC changes until Fri Sep 29 00:06:03 2017 +0000
Browse files Browse the repository at this point in the history
add QUIC crypters for IETF QUIC
Merge internal change: 170420433
https://chromium-review.googlesource.com/c/chromium/src/+/705702

Protect ourselves from QUIC suddenly closing the connection and all streams in.
This adds a method from QuicSessionInterface to QuartcSessionInterface.
Merge internal change: 170418649
https://chromium-review.googlesource.com/c/chromium/src/+/706035

Introduce a new ParsedQuicVersion struct to store both the handshake protocol and transport version parsed out of QUIC version label.
Merge internal change: 170412049
https://chromium-review.googlesource.com/c/chromium/src/+/705699

Rename the QuicVersion enum to QuicTransportVersion in preparation for support QUIC crypto and TLS at the same time, over the same version of the transport.
Merge internal change: 170400414
https://chromium-review.googlesource.com/c/chromium/src/+/706076

Add option to AEAD base crypters to use IETF nonce construction
Merge internal change: 170376079
https://chromium-review.googlesource.com/c/chromium/src/+/705697

Consolidates QuicAckFrame-building test functions in various tests into two (overloading) InitAckFrame functions in quic_test_util.
Merge internal change: 170363616
https://chromium-review.googlesource.com/c/chromium/src/+/705694

Fix documentation for QUIC's ChaCha20Poly1305 crypters
Merge internal change: 170357046
https://chromium-review.googlesource.com/c/chromium/src/+/705277

Deprecate FLAGS_quic_reloadable_flag_quic_save_data_before_consumption2.
Merge internal change: 170352428
https://chromium-review.googlesource.com/c/chromium/src/+/705276

Deprecate FLAGS_quic_reloadable_flag_quic_use_stream_notifier2.
Merge internal change: 170240760
https://chromium-review.googlesource.com/c/chromium/src/+/705176

Deprecates --gfe2_restart_flag_quic_header_list_size.
Merge internal change: 170236774
https://chromium-review.googlesource.com/c/chromium/src/+/705174

Replace a pair with a struct for lost packets and move it and the LostPacketVector to quic_types.h
Merge internal change: 170230475
https://chromium-review.googlesource.com/c/chromium/src/+/705116

Deprecate FLAGS_quic_reloadable_flag_quic_consuming_data_faster.
Merge internal change: 170227329
https://chromium-review.googlesource.com/c/chromium/src/+/704160

Default enable fixes to QUIC's Cubic congestion control to allow per ack updates and fix beta last max.
Merge internal change: 170135670
https://chromium-review.googlesource.com/c/chromium/src/+/704159

Add function to get HandshakeProtocol enum value from QuicVersionLabel
Merge internal change: 170124279
https://chromium-review.googlesource.com/c/chromium/src/+/701775

Expose QuicVersionLabel in QuicConnection
Merge internal change: 170080968
https://chromium-review.googlesource.com/c/chromium/src/+/701799

Move AckedPacketVector from QUIC's SendAlgorithmInterface to quic_types.h.
Merge internal change: 170076503
https://chromium-review.googlesource.com/c/chromium/src/+/700418

Replace TimeUntilSend() with CanSend() in SendAlgorithmInterface
Merge internal change: 169930578
https://chromium-review.googlesource.com/c/chromium/src/+/698944

In QUIC, send stateless reset token in SHLO. Protected by FLAGS_quic_reloadable_flag_quic_send_reset_token_in_shlo.
Merge internal change: 169904881
https://chromium-review.googlesource.com/c/chromium/src/+/698644

R=bnc@chromium.org, mef@chromium.org, zhongyi@chromium.org

Bug: 
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I75437c05b8bfb53a5240890297904ae65b58d6f7
Reviewed-on: https://chromium-review.googlesource.com/706394
Reviewed-by: Bence Béky <bnc@chromium.org>
Reviewed-by: Misha Efimov <mef@chromium.org>
Reviewed-by: Zhongyi Shi <zhongyi@chromium.org>
Commit-Queue: Michael Warres <mpw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507379}
  • Loading branch information
Michael Warres authored and Commit Bot committed Oct 9, 2017
1 parent c16d057 commit 74ee3ce
Show file tree
Hide file tree
Showing 249 changed files with 4,464 additions and 2,295 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ void CronetURLRequestContextAdapter::InitializeOnNetworkThread(
static_cast<uint16_t>(quic_hint->alternate_port));
context_->http_server_properties()->SetQuicAlternativeService(
quic_server, alternative_service, base::Time::Max(),
net::QuicVersionVector());
net::QuicTransportVersionVector());
}
}

Expand Down
4 changes: 2 additions & 2 deletions components/cronet/android/test/quic_test_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ void StartOnServerThread(const base::FilePath& test_files_root,
directory.Append("quic_test.example.com.key.sct")));
g_quic_server = new net::QuicSimpleServer(
std::move(proof_source), config,
net::QuicCryptoServerConfig::ConfigOptions(), net::AllSupportedVersions(),
g_quic_response_cache);
net::QuicCryptoServerConfig::ConfigOptions(),
net::AllSupportedTransportVersions(), g_quic_response_cache);

// Start listening.
int rv = g_quic_server->Listen(
Expand Down
2 changes: 1 addition & 1 deletion components/cronet/ios/cronet_environment.mm
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ bool IsNetLogPathValid(const base::FilePath& path) {
quic_hint.port());
main_context_->http_server_properties()->SetQuicAlternativeService(
quic_hint_server, alternative_service, base::Time::Max(),
net::QuicVersionVector());
net::QuicTransportVersionVector());
}

main_context_->transport_security_state()
Expand Down
2 changes: 1 addition & 1 deletion components/grpc_support/test/get_stream_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class BidirectionalStreamTestURLRequestContextGetter
url::SchemeHostPort quic_hint_server("https", kTestServerHost, 443);
server_properties_->SetQuicAlternativeService(
quic_hint_server, alternative_service, base::Time::Max(),
net::QuicVersionVector());
net::QuicTransportVersionVector());

request_context_->set_cert_verifier(mock_cert_verifier_.get());
request_context_->set_host_resolver(host_resolver_.get());
Expand Down
4 changes: 2 additions & 2 deletions components/grpc_support/test/quic_test_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ void StartQuicServerOnServerThread(const base::FilePath& test_files_root,

g_quic_server = new net::QuicSimpleServer(
std::move(proof_source), config,
net::QuicCryptoServerConfig::ConfigOptions(), net::AllSupportedVersions(),
g_quic_response_cache);
net::QuicCryptoServerConfig::ConfigOptions(),
net::AllSupportedTransportVersions(), g_quic_response_cache);

// Start listening on an unbound port.
int rv = g_quic_server->Listen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ size_t GetQuicMaxPacketLength(const VariationParameters& quic_trial_params) {
return 0;
}

net::QuicVersionVector GetQuicVersions(
net::QuicTransportVersionVector GetQuicVersions(
const VariationParameters& quic_trial_params) {
return network_session_configurator::ParseQuicVersions(
GetVariationParam(quic_trial_params, "quic_version"));
Expand Down Expand Up @@ -306,7 +306,7 @@ void ConfigureQuicParams(base::StringPiece quic_trial_group,

params->quic_user_agent_id = quic_user_agent_id;

net::QuicVersionVector supported_versions =
net::QuicTransportVersionVector supported_versions =
GetQuicVersions(quic_trial_params);
if (!supported_versions.empty())
params->quic_supported_versions = supported_versions;
Expand All @@ -316,9 +316,11 @@ void ConfigureQuicParams(base::StringPiece quic_trial_group,

namespace network_session_configurator {

net::QuicVersionVector ParseQuicVersions(const std::string& quic_versions) {
net::QuicVersionVector supported_versions;
net::QuicVersionVector all_supported_versions = net::AllSupportedVersions();
net::QuicTransportVersionVector ParseQuicVersions(
const std::string& quic_versions) {
net::QuicTransportVersionVector supported_versions;
net::QuicTransportVersionVector all_supported_versions =
net::AllSupportedTransportVersions();

for (const base::StringPiece& version : base::SplitStringPiece(
quic_versions, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
Expand Down Expand Up @@ -385,7 +387,7 @@ void ParseCommandLineAndFieldTrials(const base::CommandLine& command_line,
}

if (command_line.HasSwitch(switches::kQuicVersion)) {
net::QuicVersionVector supported_versions =
net::QuicTransportVersionVector supported_versions =
network_session_configurator::ParseQuicVersions(
command_line.GetSwitchValueASCII(switches::kQuicVersion));
if (!supported_versions.empty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ namespace network_session_configurator {
// trials and command line.

// Parse serialized QUIC versions string.
net::QuicVersionVector ParseQuicVersions(const std::string& quic_versions);
net::QuicTransportVersionVector ParseQuicVersions(
const std::string& quic_versions);

// Configure |params| based on field trials and command line,
// and forcing (policy or other command line) arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,50 +287,52 @@ TEST_F(NetworkSessionConfiguratorTest, PacketLengthFromFieldTrialParams) {
TEST_F(NetworkSessionConfiguratorTest, QuicVersionFromFieldTrialParams) {
std::map<std::string, std::string> field_trial_params;
field_trial_params["quic_version"] =
net::QuicVersionToString(net::AllSupportedVersions().back());
net::QuicVersionToString(net::AllSupportedTransportVersions().back());
variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params);
base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled");

ParseFieldTrials();

net::QuicVersionVector supported_versions;
supported_versions.push_back(net::AllSupportedVersions().back());
net::QuicTransportVersionVector supported_versions;
supported_versions.push_back(net::AllSupportedTransportVersions().back());
EXPECT_EQ(supported_versions, params_.quic_supported_versions);
}

TEST_F(NetworkSessionConfiguratorTest,
MultipleQuicVersionFromFieldTrialParams) {
std::map<std::string, std::string> field_trial_params;
std::string quic_versions =
net::QuicVersionToString(net::AllSupportedVersions().front()) + "," +
net::QuicVersionToString(net::AllSupportedVersions().back());
net::QuicVersionToString(net::AllSupportedTransportVersions().front()) +
"," +
net::QuicVersionToString(net::AllSupportedTransportVersions().back());

field_trial_params["quic_version"] = quic_versions;
variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params);
base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled");

ParseFieldTrials();

net::QuicVersionVector supported_versions;
supported_versions.push_back(net::AllSupportedVersions().front());
supported_versions.push_back(net::AllSupportedVersions().back());
net::QuicTransportVersionVector supported_versions;
supported_versions.push_back(net::AllSupportedTransportVersions().front());
supported_versions.push_back(net::AllSupportedTransportVersions().back());
EXPECT_EQ(supported_versions, params_.quic_supported_versions);
}

TEST_F(NetworkSessionConfiguratorTest, SameQuicVersionsFromFieldTrialParams) {
std::map<std::string, std::string> field_trial_params;
std::string quic_versions =
net::QuicVersionToString(net::AllSupportedVersions().front()) + "," +
net::QuicVersionToString(net::AllSupportedVersions().front());
net::QuicVersionToString(net::AllSupportedTransportVersions().front()) +
"," +
net::QuicVersionToString(net::AllSupportedTransportVersions().front());

field_trial_params["quic_version"] = quic_versions;
variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params);
base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled");

ParseFieldTrials();

net::QuicVersionVector supported_versions;
supported_versions.push_back(net::AllSupportedVersions().front());
net::QuicTransportVersionVector supported_versions;
supported_versions.push_back(net::AllSupportedTransportVersions().front());
EXPECT_EQ(supported_versions, params_.quic_supported_versions);
}

Expand Down Expand Up @@ -458,7 +460,8 @@ TEST_F(NetworkSessionConfiguratorTest, QuicMaxPacketLength) {
}

TEST_F(NetworkSessionConfiguratorTest, QuicVersion) {
net::QuicVersionVector supported_versions = net::AllSupportedVersions();
net::QuicTransportVersionVector supported_versions =
net::AllSupportedTransportVersions();
for (const auto& version : supported_versions) {
base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
command_line.AppendSwitch(switches::kEnableQuic);
Expand Down
18 changes: 18 additions & 0 deletions net/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1177,12 +1177,24 @@ component("net") {
"quic/core/crypto/aes_128_gcm_12_decrypter.h",
"quic/core/crypto/aes_128_gcm_12_encrypter.cc",
"quic/core/crypto/aes_128_gcm_12_encrypter.h",
"quic/core/crypto/aes_128_gcm_decrypter.cc",
"quic/core/crypto/aes_128_gcm_decrypter.h",
"quic/core/crypto/aes_128_gcm_encrypter.cc",
"quic/core/crypto/aes_128_gcm_encrypter.h",
"quic/core/crypto/aes_256_gcm_decrypter.cc",
"quic/core/crypto/aes_256_gcm_decrypter.h",
"quic/core/crypto/aes_256_gcm_encrypter.cc",
"quic/core/crypto/aes_256_gcm_encrypter.h",
"quic/core/crypto/cert_compressor.cc",
"quic/core/crypto/cert_compressor.h",
"quic/core/crypto/chacha20_poly1305_decrypter.cc",
"quic/core/crypto/chacha20_poly1305_decrypter.h",
"quic/core/crypto/chacha20_poly1305_encrypter.cc",
"quic/core/crypto/chacha20_poly1305_encrypter.h",
"quic/core/crypto/chacha20_poly1305_tls_decrypter.cc",
"quic/core/crypto/chacha20_poly1305_tls_decrypter.h",
"quic/core/crypto/chacha20_poly1305_tls_encrypter.cc",
"quic/core/crypto/chacha20_poly1305_tls_encrypter.h",
"quic/core/crypto/channel_id.cc",
"quic/core/crypto/channel_id.h",
"quic/core/crypto/common_cert_set.cc",
Expand Down Expand Up @@ -4970,9 +4982,15 @@ test("net_unittests") {
"quic/core/congestion_control/windowed_filter_test.cc",
"quic/core/crypto/aes_128_gcm_12_decrypter_test.cc",
"quic/core/crypto/aes_128_gcm_12_encrypter_test.cc",
"quic/core/crypto/aes_128_gcm_decrypter_test.cc",
"quic/core/crypto/aes_128_gcm_encrypter_test.cc",
"quic/core/crypto/aes_256_gcm_decrypter_test.cc",
"quic/core/crypto/aes_256_gcm_encrypter_test.cc",
"quic/core/crypto/cert_compressor_test.cc",
"quic/core/crypto/chacha20_poly1305_decrypter_test.cc",
"quic/core/crypto/chacha20_poly1305_encrypter_test.cc",
"quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc",
"quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc",
"quic/core/crypto/channel_id_test.cc",
"quic/core/crypto/common_cert_set_test.cc",
"quic/core/crypto/crypto_framer_test.cc",
Expand Down
2 changes: 1 addition & 1 deletion net/http/http_network_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class NET_EXPORT HttpNetworkSession : public base::MemoryCoordinatorClient {
// QUIC runtime configuration options.

// Versions of QUIC which may be used.
QuicVersionVector quic_supported_versions;
QuicTransportVersionVector quic_supported_versions;
// User agent description to send in the QUIC handshake.
std::string quic_user_agent_id;
// Limit on the size of QUIC packets.
Expand Down
6 changes: 3 additions & 3 deletions net/http/http_server_properties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ AlternativeServiceInfo::CreateHttp2AlternativeServiceInfo(
base::Time expiration) {
DCHECK_EQ(alternative_service.protocol, kProtoHTTP2);
return AlternativeServiceInfo(alternative_service, expiration,
QuicVersionVector());
QuicTransportVersionVector());
}

// static
AlternativeServiceInfo AlternativeServiceInfo::CreateQuicAlternativeServiceInfo(
const AlternativeService& alternative_service,
base::Time expiration,
const QuicVersionVector& advertised_versions) {
const QuicTransportVersionVector& advertised_versions) {
DCHECK_EQ(alternative_service.protocol, kProtoQUIC);
return AlternativeServiceInfo(alternative_service, expiration,
advertised_versions);
Expand All @@ -106,7 +106,7 @@ AlternativeServiceInfo::~AlternativeServiceInfo() {}
AlternativeServiceInfo::AlternativeServiceInfo(
const AlternativeService& alternative_service,
base::Time expiration,
const QuicVersionVector& advertised_versions)
const QuicTransportVersionVector& advertised_versions)
: alternative_service_(alternative_service), expiration_(expiration) {
if (alternative_service_.protocol == kProtoQUIC) {
advertised_versions_ = advertised_versions;
Expand Down
13 changes: 7 additions & 6 deletions net/http/http_server_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class NET_EXPORT_PRIVATE AlternativeServiceInfo {
static AlternativeServiceInfo CreateQuicAlternativeServiceInfo(
const AlternativeService& alternative_service,
base::Time expiration,
const QuicVersionVector& advertised_versions);
const QuicTransportVersionVector& advertised_versions);

AlternativeServiceInfo();
~AlternativeServiceInfo();
Expand Down Expand Up @@ -170,7 +170,8 @@ class NET_EXPORT_PRIVATE AlternativeServiceInfo {
expiration_ = expiration;
}

void set_advertised_versions(const QuicVersionVector& advertised_versions) {
void set_advertised_versions(
const QuicTransportVersionVector& advertised_versions) {
if (alternative_service_.protocol != kProtoQUIC)
return;

Expand All @@ -190,14 +191,14 @@ class NET_EXPORT_PRIVATE AlternativeServiceInfo {

base::Time expiration() const { return expiration_; }

const QuicVersionVector& advertised_versions() const {
const QuicTransportVersionVector& advertised_versions() const {
return advertised_versions_;
}

private:
AlternativeServiceInfo(const AlternativeService& alternative_service,
base::Time expiration,
const QuicVersionVector& advertised_versions);
const QuicTransportVersionVector& advertised_versions);

AlternativeService alternative_service_;
base::Time expiration_;
Expand All @@ -206,7 +207,7 @@ class NET_EXPORT_PRIVATE AlternativeServiceInfo {
// by Chrome. If empty, defaults to versions used by the current instance of
// the netstack.
// This list MUST be sorted in ascending order.
QuicVersionVector advertised_versions_;
QuicTransportVersionVector advertised_versions_;
};

struct NET_EXPORT SupportsQuic {
Expand Down Expand Up @@ -328,7 +329,7 @@ class NET_EXPORT HttpServerProperties {
const url::SchemeHostPort& origin,
const AlternativeService& alternative_service,
base::Time expiration,
const QuicVersionVector& advertised_versions) = 0;
const QuicTransportVersionVector& advertised_versions) = 0;

// Set alternative services for |origin|. Previous alternative services for
// |origin| are discarded.
Expand Down
2 changes: 1 addition & 1 deletion net/http/http_server_properties_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ bool HttpServerPropertiesImpl::SetQuicAlternativeService(
const url::SchemeHostPort& origin,
const AlternativeService& alternative_service,
base::Time expiration,
const QuicVersionVector& advertised_versions) {
const QuicTransportVersionVector& advertised_versions) {
DCHECK(alternative_service.protocol == kProtoQUIC);

return SetAlternativeServices(
Expand Down
2 changes: 1 addition & 1 deletion net/http/http_server_properties_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class NET_EXPORT HttpServerPropertiesImpl
const url::SchemeHostPort& origin,
const AlternativeService& alternative_service,
base::Time expiration,
const QuicVersionVector& advertised_versions) override;
const QuicTransportVersionVector& advertised_versions) override;
bool SetAlternativeServices(const url::SchemeHostPort& origin,
const AlternativeServiceInfoVector&
alternative_service_info_vector) override;
Expand Down
6 changes: 3 additions & 3 deletions net/http/http_server_properties_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ bool HttpServerPropertiesManager::SetQuicAlternativeService(
const url::SchemeHostPort& origin,
const AlternativeService& alternative_service,
base::Time expiration,
const QuicVersionVector& advertised_versions) {
const QuicTransportVersionVector& advertised_versions) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
const bool changed = http_server_properties_impl_->SetQuicAlternativeService(
origin, alternative_service, expiration, advertised_versions);
Expand Down Expand Up @@ -820,15 +820,15 @@ bool HttpServerPropertiesManager::ParseAlternativeServiceInfoDictOfServer(
<< "server: " << server_str;
return false;
}
QuicVersionVector advertised_versions;
QuicTransportVersionVector advertised_versions;
for (const auto& value : *versions_list) {
int version;
if (!value.GetAsInteger(&version)) {
DVLOG(1) << "Malformed alternative service version for server: "
<< server_str;
return false;
}
advertised_versions.push_back(QuicVersion(version));
advertised_versions.push_back(QuicTransportVersion(version));
}
alternative_service_info->set_advertised_versions(advertised_versions);
}
Expand Down
2 changes: 1 addition & 1 deletion net/http/http_server_properties_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties {
const url::SchemeHostPort& origin,
const AlternativeService& alternative_service,
base::Time expiration,
const QuicVersionVector& advertised_versions) override;
const QuicTransportVersionVector& advertised_versions) override;
bool SetAlternativeServices(const url::SchemeHostPort& origin,
const AlternativeServiceInfoVector&
alternative_service_info_vector) override;
Expand Down
Loading

0 comments on commit 74ee3ce

Please sign in to comment.