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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 CryptoFramer::ConstructHandshakeMessage(server_config_update)); | 220 CryptoFramer::ConstructHandshakeMessage(server_config_update)); |
221 stream()->OnStreamFrame(QuicStreamFrame(kCryptoStreamId, /*fin=*/false, | 221 stream()->OnStreamFrame(QuicStreamFrame(kCryptoStreamId, /*fin=*/false, |
222 /*offset=*/0, data->AsStringPiece())); | 222 /*offset=*/0, data->AsStringPiece())); |
223 | 223 |
224 // Make sure that the STK and SCFG are cached correctly. | 224 // Make sure that the STK and SCFG are cached correctly. |
225 EXPECT_EQ("xstk", state->source_address_token()); | 225 EXPECT_EQ("xstk", state->source_address_token()); |
226 | 226 |
227 const string& cached_scfg = state->server_config(); | 227 const string& cached_scfg = state->server_config(); |
228 test::CompareCharArraysWithHexError( | 228 test::CompareCharArraysWithHexError( |
229 "scfg", cached_scfg.data(), cached_scfg.length(), | 229 "scfg", cached_scfg.data(), cached_scfg.length(), |
230 QuicUtils::AsChars(scfg), arraysize(scfg)); | 230 reinterpret_cast<char*>(scfg), arraysize(scfg)); |
| 231 |
231 QuicStreamSequencer* sequencer = QuicStreamPeer::sequencer(stream()); | 232 QuicStreamSequencer* sequencer = QuicStreamPeer::sequencer(stream()); |
232 EXPECT_NE(FLAGS_quic_release_crypto_stream_buffer, | 233 EXPECT_NE(FLAGS_quic_release_crypto_stream_buffer, |
233 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); | 234 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); |
234 } | 235 } |
235 | 236 |
236 TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdateBeforeHandshake) { | 237 TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdateBeforeHandshake) { |
237 EXPECT_CALL( | 238 EXPECT_CALL( |
238 *connection_, | 239 *connection_, |
239 CloseConnection(QUIC_CRYPTO_UPDATE_BEFORE_HANDSHAKE_COMPLETE, _, _)); | 240 CloseConnection(QUIC_CRYPTO_UPDATE_BEFORE_HANDSHAKE_COMPLETE, _, _)); |
240 CryptoHandshakeMessage server_config_update; | 241 CryptoHandshakeMessage server_config_update; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 client_state->GetNextServerDesignatedConnectionId(); | 389 client_state->GetNextServerDesignatedConnectionId(); |
389 QuicConnectionId expected_id = | 390 QuicConnectionId expected_id = |
390 server_session_->connection()->random_generator()->RandUint64(); | 391 server_session_->connection()->random_generator()->RandUint64(); |
391 EXPECT_EQ(expected_id, server_designated_id); | 392 EXPECT_EQ(expected_id, server_designated_id); |
392 EXPECT_FALSE(client_state->has_server_designated_connection_id()); | 393 EXPECT_FALSE(client_state->has_server_designated_connection_id()); |
393 } | 394 } |
394 | 395 |
395 } // namespace | 396 } // namespace |
396 } // namespace test | 397 } // namespace test |
397 } // namespace net | 398 } // namespace net |
OLD | NEW |