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

Side by Side Diff: net/quic/crypto/quic_crypto_client_config_test.cc

Issue 1904213002: QUIC: support diversified keys with version 33. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hkdf
Patch Set: Rebase Created 4 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/crypto/quic_crypto_client_config.h" 5 #include "net/quic/crypto/quic_crypto_client_config.h"
6 6
7 #include "net/quic/crypto/proof_verifier.h" 7 #include "net/quic/crypto/proof_verifier.h"
8 #include "net/quic/quic_server_id.h" 8 #include "net/quic/quic_server_id.h"
9 #include "net/quic/test_tools/crypto_test_utils.h" 9 #include "net/quic/test_tools/crypto_test_utils.h"
10 #include "net/quic/test_tools/mock_random.h" 10 #include "net/quic/test_tools/mock_random.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 TEST(QuicCryptoClientConfigTest, FillClientHello) { 236 TEST(QuicCryptoClientConfigTest, FillClientHello) {
237 QuicCryptoClientConfig::CachedState state; 237 QuicCryptoClientConfig::CachedState state;
238 QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting()); 238 QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
239 QuicCryptoNegotiatedParameters params; 239 QuicCryptoNegotiatedParameters params;
240 QuicConnectionId kConnectionId = 1234; 240 QuicConnectionId kConnectionId = 1234;
241 string error_details; 241 string error_details;
242 MockRandom rand; 242 MockRandom rand;
243 CryptoHandshakeMessage chlo; 243 CryptoHandshakeMessage chlo;
244 QuicServerId server_id("www.google.com", 443, PRIVACY_MODE_DISABLED); 244 QuicServerId server_id("www.google.com", 443, PRIVACY_MODE_DISABLED);
245 config.FillClientHello(server_id, kConnectionId, QuicVersionMax(), &state, 245 config.FillClientHello(server_id, kConnectionId, QuicVersionMax(),
246 QuicWallTime::Zero(), &rand, 246 QuicVersionMax(), &state, QuicWallTime::Zero(), &rand,
247 nullptr, // channel_id_key 247 nullptr, // channel_id_key
248 &params, &chlo, &error_details); 248 &params, &chlo, &error_details);
249 249
250 // Verify that certain QuicTags have been set correctly in the CHLO. 250 // Verify that certain QuicTags have been set correctly in the CHLO.
251 QuicTag cver; 251 QuicTag cver;
252 EXPECT_EQ(QUIC_NO_ERROR, chlo.GetUint32(kVER, &cver)); 252 EXPECT_EQ(QUIC_NO_ERROR, chlo.GetUint32(kVER, &cver));
253 EXPECT_EQ(QuicVersionToQuicTag(QuicVersionMax()), cver); 253 EXPECT_EQ(QuicVersionToQuicTag(QuicVersionMax()), cver);
254 } 254 }
255 255
256 TEST(QuicCryptoClientConfigTest, ProcessServerDowngradeAttack) { 256 TEST(QuicCryptoClientConfigTest, ProcessServerDowngradeAttack) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 QuicCryptoNegotiatedParameters out_params; 474 QuicCryptoNegotiatedParameters out_params;
475 string error_details; 475 string error_details;
476 EXPECT_EQ(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER, 476 EXPECT_EQ(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER,
477 config.ProcessServerHello(msg, 0, version, supported_versions, 477 config.ProcessServerHello(msg, 0, version, supported_versions,
478 &cached, &out_params, &error_details)); 478 &cached, &out_params, &error_details));
479 EXPECT_EQ("server hello missing server nonce", error_details); 479 EXPECT_EQ("server hello missing server nonce", error_details);
480 } 480 }
481 481
482 } // namespace test 482 } // namespace test
483 } // namespace net 483 } // namespace net
OLDNEW
« 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