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 | 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 Loading... |
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 Loading... |
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 |
OLD | NEW |