Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: net/quic/core/quic_crypto_client_stream_test.cc

Issue 2289243003: Store the QUIC server's crypto config expiration time explicitly in the client's CachedState, inste… (Closed)
Patch Set: Store the QUIC server's crypto config expiration time explicitly in the client's CachedState, inste… Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/core/crypto/quic_crypto_client_config.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 8
9 #include "net/quic/core/crypto/aes_128_gcm_12_encrypter.h" 9 #include "net/quic/core/crypto/aes_128_gcm_12_encrypter.h"
10 #include "net/quic/core/crypto/quic_decrypter.h" 10 #include "net/quic/core/crypto/quic_decrypter.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 CreateConnection(); 134 CreateConnection();
135 135
136 // Advance time 5 years to ensure that we pass the expiry time of the cached 136 // Advance time 5 years to ensure that we pass the expiry time of the cached
137 // server config. 137 // server config.
138 connection_->AdvanceTime( 138 connection_->AdvanceTime(
139 QuicTime::Delta::FromSeconds(60 * 60 * 24 * 365 * 5)); 139 QuicTime::Delta::FromSeconds(60 * 60 * 24 * 365 * 5));
140 140
141 stream()->CryptoConnect(); 141 stream()->CryptoConnect();
142 // Check that a client hello was sent. 142 // Check that a client hello was sent.
143 ASSERT_EQ(1u, connection_->encrypted_packets_.size()); 143 ASSERT_EQ(1u, connection_->encrypted_packets_.size());
144 EXPECT_EQ(ENCRYPTION_NONE, connection_->encryption_level());
144 } 145 }
145 146
146 TEST_F(QuicCryptoClientStreamTest, InvalidCachedServerConfig) { 147 TEST_F(QuicCryptoClientStreamTest, InvalidCachedServerConfig) {
147 // Seed the config with a cached server config. 148 // Seed the config with a cached server config.
148 CompleteCryptoHandshake(); 149 CompleteCryptoHandshake();
149 150
150 // Recreate connection with the new config. 151 // Recreate connection with the new config.
151 CreateConnection(); 152 CreateConnection();
152 153
153 QuicCryptoClientConfig::CachedState* state = 154 QuicCryptoClientConfig::CachedState* state =
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 client_state->GetNextServerDesignatedConnectionId(); 356 client_state->GetNextServerDesignatedConnectionId();
356 QuicConnectionId expected_id = 357 QuicConnectionId expected_id =
357 server_session_->connection()->random_generator()->RandUint64(); 358 server_session_->connection()->random_generator()->RandUint64();
358 EXPECT_EQ(expected_id, server_designated_id); 359 EXPECT_EQ(expected_id, server_designated_id);
359 EXPECT_FALSE(client_state->has_server_designated_connection_id()); 360 EXPECT_FALSE(client_state->has_server_designated_connection_id());
360 } 361 }
361 362
362 } // namespace 363 } // namespace
363 } // namespace test 364 } // namespace test
364 } // namespace net 365 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/crypto/quic_crypto_client_config.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698