| 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/quic_crypto_client_stream.h" | 5 #include "net/quic/quic_crypto_client_stream.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" | 8 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" |
| 9 #include "net/quic/crypto/quic_decrypter.h" | 9 #include "net/quic/crypto/quic_decrypter.h" |
| 10 #include "net/quic/crypto/quic_encrypter.h" | 10 #include "net/quic/crypto/quic_encrypter.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 // Recreate connection with the new config. | 147 // Recreate connection with the new config. |
| 148 CreateConnection(); | 148 CreateConnection(); |
| 149 | 149 |
| 150 QuicCryptoClientConfig::CachedState* state = | 150 QuicCryptoClientConfig::CachedState* state = |
| 151 crypto_config_.LookupOrCreate(server_id_); | 151 crypto_config_.LookupOrCreate(server_id_); |
| 152 | 152 |
| 153 vector<string> certs = state->certs(); | 153 vector<string> certs = state->certs(); |
| 154 string cert_sct = state->cert_sct(); | 154 string cert_sct = state->cert_sct(); |
| 155 string signature = state->signature(); | 155 string signature = state->signature(); |
| 156 state->SetProof(certs, cert_sct, signature + signature); | 156 string chlo_hash = state->chlo_hash(); |
| 157 state->SetProof(certs, cert_sct, chlo_hash, signature + signature); |
| 157 | 158 |
| 158 stream()->CryptoConnect(); | 159 stream()->CryptoConnect(); |
| 159 // Check that a client hello was sent. | 160 // Check that a client hello was sent. |
| 160 ASSERT_EQ(1u, connection_->encrypted_packets_.size()); | 161 ASSERT_EQ(1u, connection_->encrypted_packets_.size()); |
| 161 } | 162 } |
| 162 | 163 |
| 163 TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdate) { | 164 TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdate) { |
| 164 // Test that the crypto client stream can receive server config updates after | 165 // Test that the crypto client stream can receive server config updates after |
| 165 // the connection has been established. | 166 // the connection has been established. |
| 166 CompleteCryptoHandshake(); | 167 CompleteCryptoHandshake(); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 client_state->GetNextServerDesignatedConnectionId(); | 345 client_state->GetNextServerDesignatedConnectionId(); |
| 345 QuicConnectionId expected_id = | 346 QuicConnectionId expected_id = |
| 346 server_session_->connection()->random_generator()->RandUint64(); | 347 server_session_->connection()->random_generator()->RandUint64(); |
| 347 EXPECT_EQ(expected_id, server_designated_id); | 348 EXPECT_EQ(expected_id, server_designated_id); |
| 348 EXPECT_FALSE(client_state->has_server_designated_connection_id()); | 349 EXPECT_FALSE(client_state->has_server_designated_connection_id()); |
| 349 } | 350 } |
| 350 | 351 |
| 351 } // namespace | 352 } // namespace |
| 352 } // namespace test | 353 } // namespace test |
| 353 } // namespace net | 354 } // namespace net |
| OLD | NEW |