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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 TEST_F(QuicCryptoClientStreamTest, InvalidCachedServerConfig) { | 164 TEST_F(QuicCryptoClientStreamTest, InvalidCachedServerConfig) { |
165 // Seed the config with a cached server config. | 165 // Seed the config with a cached server config. |
166 CompleteCryptoHandshake(); | 166 CompleteCryptoHandshake(); |
167 | 167 |
168 // Recreate connection with the new config. | 168 // Recreate connection with the new config. |
169 CreateConnection(); | 169 CreateConnection(); |
170 | 170 |
171 QuicCryptoClientConfig::CachedState* state = | 171 QuicCryptoClientConfig::CachedState* state = |
172 crypto_config_.LookupOrCreate(server_id_); | 172 crypto_config_.LookupOrCreate(server_id_); |
173 | 173 |
174 vector<string> certs = state->certs(); | 174 std::vector<string> certs = state->certs(); |
175 string cert_sct = state->cert_sct(); | 175 string cert_sct = state->cert_sct(); |
176 string signature = state->signature(); | 176 string signature = state->signature(); |
177 string chlo_hash = state->chlo_hash(); | 177 string chlo_hash = state->chlo_hash(); |
178 state->SetProof(certs, cert_sct, chlo_hash, signature + signature); | 178 state->SetProof(certs, cert_sct, chlo_hash, signature + signature); |
179 | 179 |
180 stream()->CryptoConnect(); | 180 stream()->CryptoConnect(); |
181 // Check that a client hello was sent. | 181 // Check that a client hello was sent. |
182 ASSERT_EQ(1u, connection_->encrypted_packets_.size()); | 182 ASSERT_EQ(1u, connection_->encrypted_packets_.size()); |
183 } | 183 } |
184 | 184 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 client_state->GetNextServerDesignatedConnectionId(); | 391 client_state->GetNextServerDesignatedConnectionId(); |
392 QuicConnectionId expected_id = | 392 QuicConnectionId expected_id = |
393 server_session_->connection()->random_generator()->RandUint64(); | 393 server_session_->connection()->random_generator()->RandUint64(); |
394 EXPECT_EQ(expected_id, server_designated_id); | 394 EXPECT_EQ(expected_id, server_designated_id); |
395 EXPECT_FALSE(client_state->has_server_designated_connection_id()); | 395 EXPECT_FALSE(client_state->has_server_designated_connection_id()); |
396 } | 396 } |
397 | 397 |
398 } // namespace | 398 } // namespace |
399 } // namespace test | 399 } // namespace test |
400 } // namespace net | 400 } // namespace net |
OLD | NEW |