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

Unified Diff: net/quic/crypto/quic_crypto_server_config_test.cc

Issue 1660593004: Landing Recent QUIC changes until 01/28/2016 18:41 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0202
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/crypto/quic_crypto_server_config.cc ('k') | net/quic/quic_chromium_client_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/quic_crypto_server_config_test.cc
diff --git a/net/quic/crypto/quic_crypto_server_config_test.cc b/net/quic/crypto/quic_crypto_server_config_test.cc
index d7a887ed83757b4eab87133aae0110bb9c36b3f8..619ad868149ea52c31ee2cc1210167152f47ef3a 100644
--- a/net/quic/crypto/quic_crypto_server_config_test.cc
+++ b/net/quic/crypto/quic_crypto_server_config_test.cc
@@ -221,8 +221,37 @@ TEST(QuicCryptoServerConfigTest, ServerConfig) {
CryptoTestUtils::ProofSourceForTesting());
MockClock clock;
- scoped_ptr<CryptoHandshakeMessage>(server.AddDefaultConfig(
+ scoped_ptr<CryptoHandshakeMessage> message(server.AddDefaultConfig(
rand, &clock, QuicCryptoServerConfig::ConfigOptions()));
+
+ // The default configuration should have AES-GCM and at least one ChaCha20
+ // cipher.
+ const QuicTag* aead_tags;
+ size_t aead_len;
+ ASSERT_EQ(QUIC_NO_ERROR, message->GetTaglist(kAEAD, &aead_tags, &aead_len));
+ vector<QuicTag> aead(aead_tags, aead_tags + aead_len);
+ EXPECT_THAT(aead, ::testing::Contains(kAESG));
+ EXPECT_LE(2u, aead.size());
+}
+
+TEST(QuicCryptoServerConfigTest, ServerConfigDisableChaCha) {
+ ValueRestore<bool> old_flag(
+ &FLAGS_quic_crypto_server_config_default_has_chacha20, false);
+ QuicRandom* rand = QuicRandom::GetInstance();
+ QuicCryptoServerConfig server(QuicCryptoServerConfig::TESTING, rand,
+ CryptoTestUtils::ProofSourceForTesting());
+ MockClock clock;
+
+ scoped_ptr<CryptoHandshakeMessage> message(server.AddDefaultConfig(
+ rand, &clock, QuicCryptoServerConfig::ConfigOptions()));
+
+ // The default configuration should only contain AES-GCM when ChaCha20 has
+ // been disabled.
+ const QuicTag* aead_tags;
+ size_t aead_len;
+ ASSERT_EQ(QUIC_NO_ERROR, message->GetTaglist(kAEAD, &aead_tags, &aead_len));
+ vector<QuicTag> aead(aead_tags, aead_tags + aead_len);
+ EXPECT_THAT(aead, ::testing::ElementsAre(kAESG));
}
TEST(QuicCryptoServerConfigTest, GetOrbitIsCalledWithoutTheStrikeRegisterLock) {
« no previous file with comments | « net/quic/crypto/quic_crypto_server_config.cc ('k') | net/quic/quic_chromium_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698