Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: net/quic/core/quic_crypto_client_stream_test.cc

Issue 2430973004: Landing Recent QUIC changes until 10:38 AM, Oct 17, 2016 UTC-4 (Closed)
Patch Set: Improving flagsaver logging Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_connection_test.cc ('k') | net/quic/core/quic_crypto_server_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 EXPECT_EQ(0u, stream()->crypto_negotiated_params().token_binding_key_param); 277 EXPECT_EQ(0u, stream()->crypto_negotiated_params().token_binding_key_param);
278 } 278 }
279 279
280 TEST_F(QuicCryptoClientStreamTest, TokenBindingNotNegotiated) { 280 TEST_F(QuicCryptoClientStreamTest, TokenBindingNotNegotiated) {
281 CompleteCryptoHandshake(); 281 CompleteCryptoHandshake();
282 EXPECT_TRUE(stream()->encryption_established()); 282 EXPECT_TRUE(stream()->encryption_established());
283 EXPECT_TRUE(stream()->handshake_confirmed()); 283 EXPECT_TRUE(stream()->handshake_confirmed());
284 EXPECT_EQ(0u, stream()->crypto_negotiated_params().token_binding_key_param); 284 EXPECT_EQ(0u, stream()->crypto_negotiated_params().token_binding_key_param);
285 } 285 }
286 286
287 TEST_F(QuicCryptoClientStreamTest, NoTokenBindingInPrivacyMode) {
288 server_options_.token_binding_params = QuicTagVector{kTB10};
289 crypto_config_.tb_key_params = QuicTagVector{kTB10};
290 server_id_ = QuicServerId(kServerHostname, kServerPort, PRIVACY_MODE_ENABLED);
291 CreateConnection();
292
293 CompleteCryptoHandshake();
294 EXPECT_TRUE(stream()->encryption_established());
295 EXPECT_TRUE(stream()->handshake_confirmed());
296 EXPECT_EQ(0u, stream()->crypto_negotiated_params().token_binding_key_param);
297 }
298
287 class QuicCryptoClientStreamStatelessTest : public ::testing::Test { 299 class QuicCryptoClientStreamStatelessTest : public ::testing::Test {
288 public: 300 public:
289 QuicCryptoClientStreamStatelessTest() 301 QuicCryptoClientStreamStatelessTest()
290 : client_crypto_config_(CryptoTestUtils::ProofVerifierForTesting()), 302 : client_crypto_config_(CryptoTestUtils::ProofVerifierForTesting()),
291 server_crypto_config_(QuicCryptoServerConfig::TESTING, 303 server_crypto_config_(QuicCryptoServerConfig::TESTING,
292 QuicRandom::GetInstance(), 304 QuicRandom::GetInstance(),
293 CryptoTestUtils::ProofSourceForTesting()), 305 CryptoTestUtils::ProofSourceForTesting()),
294 server_compressed_certs_cache_( 306 server_compressed_certs_cache_(
295 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize), 307 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize),
296 server_id_(kServerHostname, kServerPort, PRIVACY_MODE_DISABLED) { 308 server_id_(kServerHostname, kServerPort, PRIVACY_MODE_DISABLED) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 client_state->GetNextServerDesignatedConnectionId(); 391 client_state->GetNextServerDesignatedConnectionId();
380 QuicConnectionId expected_id = 392 QuicConnectionId expected_id =
381 server_session_->connection()->random_generator()->RandUint64(); 393 server_session_->connection()->random_generator()->RandUint64();
382 EXPECT_EQ(expected_id, server_designated_id); 394 EXPECT_EQ(expected_id, server_designated_id);
383 EXPECT_FALSE(client_state->has_server_designated_connection_id()); 395 EXPECT_FALSE(client_state->has_server_designated_connection_id());
384 } 396 }
385 397
386 } // namespace 398 } // namespace
387 } // namespace test 399 } // namespace test
388 } // namespace net 400 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_connection_test.cc ('k') | net/quic/core/quic_crypto_server_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698