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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 QuicCryptoClientConfig::CachedState* client_state = | 259 QuicCryptoClientConfig::CachedState* client_state = |
260 client_crypto_config_.LookupOrCreate(server_id_); | 260 client_crypto_config_.LookupOrCreate(server_id_); |
261 | 261 |
262 EXPECT_FALSE(client_state->has_server_designated_connection_id()); | 262 EXPECT_FALSE(client_state->has_server_designated_connection_id()); |
263 EXPECT_CALL(*client_session_, OnProofValid(testing::_)); | 263 EXPECT_CALL(*client_session_, OnProofValid(testing::_)); |
264 | 264 |
265 InitializeFakeStatelessRejectServer(); | 265 InitializeFakeStatelessRejectServer(); |
266 AdvanceHandshakeWithFakeServer(); | 266 AdvanceHandshakeWithFakeServer(); |
267 | 267 |
268 EXPECT_EQ(1, server_stream()->num_handshake_messages()); | 268 EXPECT_EQ(1, server_stream()->NumHandshakeMessages()); |
269 EXPECT_EQ(0, server_stream()->num_handshake_messages_with_server_nonces()); | 269 EXPECT_EQ(0, server_stream()->NumHandshakeMessagesWithServerNonces()); |
270 | 270 |
271 EXPECT_FALSE(client_session_->GetCryptoStream()->encryption_established()); | 271 EXPECT_FALSE(client_session_->GetCryptoStream()->encryption_established()); |
272 EXPECT_FALSE(client_session_->GetCryptoStream()->handshake_confirmed()); | 272 EXPECT_FALSE(client_session_->GetCryptoStream()->handshake_confirmed()); |
273 // Even though the handshake was not complete, the cached client_state is | 273 // Even though the handshake was not complete, the cached client_state is |
274 // complete, and can be used for a subsequent successful handshake. | 274 // complete, and can be used for a subsequent successful handshake. |
275 EXPECT_TRUE(client_state->IsComplete(QuicWallTime::FromUNIXSeconds(0))); | 275 EXPECT_TRUE(client_state->IsComplete(QuicWallTime::FromUNIXSeconds(0))); |
276 | 276 |
277 ASSERT_TRUE(client_state->has_server_nonce()); | 277 ASSERT_TRUE(client_state->has_server_nonce()); |
278 ASSERT_FALSE(client_state->GetNextServerNonce().empty()); | 278 ASSERT_FALSE(client_state->GetNextServerNonce().empty()); |
279 ASSERT_TRUE(client_state->has_server_designated_connection_id()); | 279 ASSERT_TRUE(client_state->has_server_designated_connection_id()); |
280 QuicConnectionId server_designated_id = | 280 QuicConnectionId server_designated_id = |
281 client_state->GetNextServerDesignatedConnectionId(); | 281 client_state->GetNextServerDesignatedConnectionId(); |
282 QuicConnectionId expected_id = | 282 QuicConnectionId expected_id = |
283 server_session_->connection()->random_generator()->RandUint64(); | 283 server_session_->connection()->random_generator()->RandUint64(); |
284 EXPECT_EQ(expected_id, server_designated_id); | 284 EXPECT_EQ(expected_id, server_designated_id); |
285 EXPECT_FALSE(client_state->has_server_designated_connection_id()); | 285 EXPECT_FALSE(client_state->has_server_designated_connection_id()); |
286 } | 286 } |
287 | 287 |
288 } // namespace | 288 } // namespace |
289 } // namespace test | 289 } // namespace test |
290 } // namespace net | 290 } // namespace net |
OLD | NEW |