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

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

Issue 1397983007: relnote: remove insecure QUIC support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rch_insecure_quic
Patch Set: Compile fix Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.cc ('k') | net/quic/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/quic_crypto_client_config_test.cc
diff --git a/net/quic/crypto/quic_crypto_client_config_test.cc b/net/quic/crypto/quic_crypto_client_config_test.cc
index 43029b81d108f9fd7a7b04679a700247d9b32c73..205ebf84568ada11f11b4954cb8b323a14d46ad1 100644
--- a/net/quic/crypto/quic_crypto_client_config_test.cc
+++ b/net/quic/crypto/quic_crypto_client_config_test.cc
@@ -6,6 +6,7 @@
#include "net/quic/crypto/proof_verifier.h"
#include "net/quic/quic_server_id.h"
+#include "net/quic/test_tools/crypto_test_utils.h"
#include "net/quic/test_tools/mock_random.h"
#include "net/quic/test_tools/quic_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -151,10 +152,10 @@ TEST(QuicCryptoClientConfigTest, CachedState_InitializeFrom) {
TEST(QuicCryptoClientConfigTest, InchoateChlo) {
QuicCryptoClientConfig::CachedState state;
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
QuicCryptoNegotiatedParameters params;
CryptoHandshakeMessage msg;
- QuicServerId server_id("www.google.com", 80, false, PRIVACY_MODE_DISABLED);
+ QuicServerId server_id("www.google.com", 80, PRIVACY_MODE_DISABLED);
config.FillInchoateClientHello(server_id, QuicVersionMax(), &state,
&params, &msg);
@@ -164,7 +165,7 @@ TEST(QuicCryptoClientConfigTest, InchoateChlo) {
}
TEST(QuicCryptoClientConfigTest, PreferAesGcm) {
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
if (config.aead.size() > 1)
EXPECT_NE(kAESG, config.aead[0]);
config.PreferAesGcm();
@@ -173,10 +174,10 @@ TEST(QuicCryptoClientConfigTest, PreferAesGcm) {
TEST(QuicCryptoClientConfigTest, InchoateChloSecure) {
QuicCryptoClientConfig::CachedState state;
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
QuicCryptoNegotiatedParameters params;
CryptoHandshakeMessage msg;
- QuicServerId server_id("www.google.com", 443, true, PRIVACY_MODE_DISABLED);
+ QuicServerId server_id("www.google.com", 443, PRIVACY_MODE_DISABLED);
config.FillInchoateClientHello(server_id, QuicVersionMax(), &state,
&params, &msg);
@@ -187,11 +188,11 @@ TEST(QuicCryptoClientConfigTest, InchoateChloSecure) {
TEST(QuicCryptoClientConfigTest, InchoateChloSecureNoEcdsa) {
QuicCryptoClientConfig::CachedState state;
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
config.DisableEcdsa();
QuicCryptoNegotiatedParameters params;
CryptoHandshakeMessage msg;
- QuicServerId server_id("www.google.com", 443, true, PRIVACY_MODE_DISABLED);
+ QuicServerId server_id("www.google.com", 443, PRIVACY_MODE_DISABLED);
config.FillInchoateClientHello(server_id, QuicVersionMax(), &state,
&params, &msg);
@@ -202,13 +203,13 @@ TEST(QuicCryptoClientConfigTest, InchoateChloSecureNoEcdsa) {
TEST(QuicCryptoClientConfigTest, FillClientHello) {
QuicCryptoClientConfig::CachedState state;
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
QuicCryptoNegotiatedParameters params;
QuicConnectionId kConnectionId = 1234;
string error_details;
MockRandom rand;
CryptoHandshakeMessage chlo;
- QuicServerId server_id("www.google.com", 80, false, PRIVACY_MODE_DISABLED);
+ QuicServerId server_id("www.google.com", 80, PRIVACY_MODE_DISABLED);
config.FillClientHello(server_id,
kConnectionId,
QuicVersionMax(),
@@ -244,7 +245,7 @@ TEST(QuicCryptoClientConfigTest, ProcessServerDowngradeAttack) {
QuicCryptoClientConfig::CachedState cached;
QuicCryptoNegotiatedParameters out_params;
string error;
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
EXPECT_EQ(QUIC_VERSION_NEGOTIATION_MISMATCH,
config.ProcessServerHello(msg, 0, supported_versions.front(),
supported_versions, &cached, &out_params,
@@ -253,17 +254,15 @@ TEST(QuicCryptoClientConfigTest, ProcessServerDowngradeAttack) {
}
TEST(QuicCryptoClientConfigTest, InitializeFrom) {
- QuicCryptoClientConfig config;
- QuicServerId canonical_server_id("www.google.com", 80, false,
- PRIVACY_MODE_DISABLED);
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
+ QuicServerId canonical_server_id("www.google.com", 80, PRIVACY_MODE_DISABLED);
QuicCryptoClientConfig::CachedState* state =
config.LookupOrCreate(canonical_server_id);
// TODO(rch): Populate other fields of |state|.
state->set_source_address_token("TOKEN");
state->SetProofValid();
- QuicServerId other_server_id("mail.google.com", 80, false,
- PRIVACY_MODE_DISABLED);
+ QuicServerId other_server_id("mail.google.com", 80, PRIVACY_MODE_DISABLED);
config.InitializeFrom(other_server_id, canonical_server_id, &config);
QuicCryptoClientConfig::CachedState* other =
config.LookupOrCreate(other_server_id);
@@ -275,12 +274,10 @@ TEST(QuicCryptoClientConfigTest, InitializeFrom) {
}
TEST(QuicCryptoClientConfigTest, Canonical) {
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
config.AddCanonicalSuffix(".google.com");
- QuicServerId canonical_id1("www.google.com", 80, false,
- PRIVACY_MODE_DISABLED);
- QuicServerId canonical_id2("mail.google.com", 80, false,
- PRIVACY_MODE_DISABLED);
+ QuicServerId canonical_id1("www.google.com", 80, PRIVACY_MODE_DISABLED);
+ QuicServerId canonical_id2("mail.google.com", 80, PRIVACY_MODE_DISABLED);
QuicCryptoClientConfig::CachedState* state =
config.LookupOrCreate(canonical_id1);
// TODO(rch): Populate other fields of |state|.
@@ -296,18 +293,15 @@ TEST(QuicCryptoClientConfigTest, Canonical) {
EXPECT_EQ(state->certs(), other->certs());
EXPECT_EQ(1u, other->generation_counter());
- QuicServerId different_id("mail.google.org", 80, false,
- PRIVACY_MODE_DISABLED);
+ QuicServerId different_id("mail.google.org", 80, PRIVACY_MODE_DISABLED);
EXPECT_TRUE(config.LookupOrCreate(different_id)->IsEmpty());
}
TEST(QuicCryptoClientConfigTest, CanonicalNotUsedIfNotValid) {
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
config.AddCanonicalSuffix(".google.com");
- QuicServerId canonical_id1("www.google.com", 80, false,
- PRIVACY_MODE_DISABLED);
- QuicServerId canonical_id2("mail.google.com", 80, false,
- PRIVACY_MODE_DISABLED);
+ QuicServerId canonical_id1("www.google.com", 80, PRIVACY_MODE_DISABLED);
+ QuicServerId canonical_id2("mail.google.com", 80, PRIVACY_MODE_DISABLED);
QuicCryptoClientConfig::CachedState* state =
config.LookupOrCreate(canonical_id1);
// TODO(rch): Populate other fields of |state|.
@@ -319,8 +313,8 @@ TEST(QuicCryptoClientConfigTest, CanonicalNotUsedIfNotValid) {
}
TEST(QuicCryptoClientConfigTest, ClearCachedStates) {
- QuicCryptoClientConfig config;
- QuicServerId server_id("www.google.com", 80, false, PRIVACY_MODE_DISABLED);
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
+ QuicServerId server_id("www.google.com", 80, PRIVACY_MODE_DISABLED);
QuicCryptoClientConfig::CachedState* state = config.LookupOrCreate(server_id);
// TODO(rch): Populate other fields of |state|.
vector<string> certs(1);
@@ -393,10 +387,9 @@ TEST(QuicCryptoClientConfigTest, ProcessReject) {
QuicCryptoClientConfig::CachedState cached;
QuicCryptoNegotiatedParameters out_params;
string error;
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
EXPECT_EQ(QUIC_NO_ERROR, config.ProcessRejection(
rej, QuicWallTime::FromUNIXSeconds(0), &cached,
- true, // is_https
&out_params, &error));
EXPECT_FALSE(cached.has_server_designated_connection_id());
EXPECT_FALSE(cached.has_server_nonce());
@@ -415,10 +408,9 @@ TEST(QuicCryptoClientConfigTest, ProcessStatelessReject) {
QuicCryptoClientConfig::CachedState cached;
QuicCryptoNegotiatedParameters out_params;
string error;
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
EXPECT_EQ(QUIC_NO_ERROR, config.ProcessRejection(
rej, QuicWallTime::FromUNIXSeconds(0), &cached,
- true, // is_https
&out_params, &error));
EXPECT_TRUE(cached.has_server_designated_connection_id());
EXPECT_EQ(kConnectionId, cached.GetNextServerDesignatedConnectionId());
@@ -435,11 +427,10 @@ TEST(QuicCryptoClientConfigTest, BadlyFormattedStatelessReject) {
QuicCryptoClientConfig::CachedState cached;
QuicCryptoNegotiatedParameters out_params;
string error;
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
EXPECT_EQ(
QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND,
config.ProcessRejection(rej, QuicWallTime::FromUNIXSeconds(0), &cached,
- true, // is_https
&out_params, &error));
EXPECT_FALSE(cached.has_server_designated_connection_id());
EXPECT_EQ("Missing kRCID", error);
@@ -459,7 +450,7 @@ TEST(QuicCryptoClientConfigTest, ServerNonceinSHLO_BeforeQ027) {
versions.push_back(QuicVersionToQuicTag(version));
msg.SetVector(kVER, versions);
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
QuicCryptoClientConfig::CachedState cached;
QuicCryptoNegotiatedParameters out_params;
string error_details;
@@ -482,7 +473,7 @@ TEST(QuicCryptoClientConfigTest, ServerNonceinSHLO_AfterQ027) {
versions.push_back(QuicVersionToQuicTag(version));
msg.SetVector(kVER, versions);
- QuicCryptoClientConfig config;
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
QuicCryptoClientConfig::CachedState cached;
QuicCryptoNegotiatedParameters out_params;
string error_details;
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.cc ('k') | net/quic/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698