| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <cstdint> | 6 #include <cstdint> |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 bool enable_stateless_rejects; | 78 bool enable_stateless_rejects; |
| 79 // If true, this forces the server to send a stateless reject when | 79 // If true, this forces the server to send a stateless reject when |
| 80 // rejecting messages. This should be a no-op if | 80 // rejecting messages. This should be a no-op if |
| 81 // enable_stateless_rejects is false. | 81 // enable_stateless_rejects is false. |
| 82 bool use_stateless_rejects; | 82 bool use_stateless_rejects; |
| 83 // Versions supported by client and server. | 83 // Versions supported by client and server. |
| 84 QuicVersionVector supported_versions; | 84 QuicVersionVector supported_versions; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 // Constructs various test permutations. | 87 // Constructs various test permutations. |
| 88 vector<TestParams> GetTestParams() { | 88 std::vector<TestParams> GetTestParams() { |
| 89 vector<TestParams> params; | 89 std::vector<TestParams> params; |
| 90 static const bool kTrueFalse[] = {true, false}; | 90 static const bool kTrueFalse[] = {true, false}; |
| 91 for (bool enable_stateless_rejects : kTrueFalse) { | 91 for (bool enable_stateless_rejects : kTrueFalse) { |
| 92 for (bool use_stateless_rejects : kTrueFalse) { | 92 for (bool use_stateless_rejects : kTrueFalse) { |
| 93 // Start with all versions, remove highest on each iteration. | 93 // Start with all versions, remove highest on each iteration. |
| 94 QuicVersionVector supported_versions = AllSupportedVersions(); | 94 QuicVersionVector supported_versions = AllSupportedVersions(); |
| 95 while (!supported_versions.empty()) { | 95 while (!supported_versions.empty()) { |
| 96 params.push_back(TestParams(enable_stateless_rejects, | 96 params.push_back(TestParams(enable_stateless_rejects, |
| 97 use_stateless_rejects, supported_versions)); | 97 use_stateless_rejects, supported_versions)); |
| 98 supported_versions.erase(supported_versions.begin()); | 98 supported_versions.erase(supported_versions.begin()); |
| 99 } | 99 } |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 EXPECT_TRUE(out_.GetStringPiece(kPROF, &proof)); | 903 EXPECT_TRUE(out_.GetStringPiece(kPROF, &proof)); |
| 904 EXPECT_TRUE(out_.GetStringPiece(kSCFG, &scfg_str)); | 904 EXPECT_TRUE(out_.GetStringPiece(kSCFG, &scfg_str)); |
| 905 std::unique_ptr<CryptoHandshakeMessage> scfg( | 905 std::unique_ptr<CryptoHandshakeMessage> scfg( |
| 906 CryptoFramer::ParseMessage(scfg_str)); | 906 CryptoFramer::ParseMessage(scfg_str)); |
| 907 StringPiece scid; | 907 StringPiece scid; |
| 908 EXPECT_TRUE(scfg->GetStringPiece(kSCID, &scid)); | 908 EXPECT_TRUE(scfg->GetStringPiece(kSCID, &scid)); |
| 909 EXPECT_NE(scid, kOldConfigId); | 909 EXPECT_NE(scid, kOldConfigId); |
| 910 | 910 |
| 911 // Get certs from compressed certs. | 911 // Get certs from compressed certs. |
| 912 const CommonCertSets* common_cert_sets(CommonCertSets::GetInstanceQUIC()); | 912 const CommonCertSets* common_cert_sets(CommonCertSets::GetInstanceQUIC()); |
| 913 vector<string> cached_certs; | 913 std::vector<string> cached_certs; |
| 914 | 914 |
| 915 vector<string> certs; | 915 std::vector<string> certs; |
| 916 ASSERT_TRUE(CertCompressor::DecompressChain(cert, cached_certs, | 916 ASSERT_TRUE(CertCompressor::DecompressChain(cert, cached_certs, |
| 917 common_cert_sets, &certs)); | 917 common_cert_sets, &certs)); |
| 918 | 918 |
| 919 // Check that the proof in the REJ message is valid. | 919 // Check that the proof in the REJ message is valid. |
| 920 std::unique_ptr<ProofVerifier> proof_verifier( | 920 std::unique_ptr<ProofVerifier> proof_verifier( |
| 921 CryptoTestUtils::ProofVerifierForTesting()); | 921 CryptoTestUtils::ProofVerifierForTesting()); |
| 922 std::unique_ptr<ProofVerifyContext> verify_context( | 922 std::unique_ptr<ProofVerifyContext> verify_context( |
| 923 CryptoTestUtils::ProofVerifyContextForTesting()); | 923 CryptoTestUtils::ProofVerifyContextForTesting()); |
| 924 std::unique_ptr<ProofVerifyDetails> details; | 924 std::unique_ptr<ProofVerifyDetails> details; |
| 925 string error_details; | 925 string error_details; |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 EXPECT_EQ(0, strike_register_client_->PendingVerifications()); | 1281 EXPECT_EQ(0, strike_register_client_->PendingVerifications()); |
| 1282 } else { | 1282 } else { |
| 1283 // version 33. | 1283 // version 33. |
| 1284 ASSERT_EQ(kSHLO, out_.tag()); | 1284 ASSERT_EQ(kSHLO, out_.tag()); |
| 1285 CheckServerHello(out_); | 1285 CheckServerHello(out_); |
| 1286 } | 1286 } |
| 1287 } | 1287 } |
| 1288 | 1288 |
| 1289 } // namespace test | 1289 } // namespace test |
| 1290 } // namespace net | 1290 } // namespace net |
| OLD | NEW |