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

Side by Side Diff: net/quic/test_tools/crypto_test_utils_test.cc

Issue 2417023003: Remove stl_util's deletion functions from: (Closed)
Patch Set: internal snapshot 10 Created 4 years, 1 month 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/test_tools/crypto_test_utils.cc ('k') | net/quic/test_tools/simple_quic_framer.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/test_tools/crypto_test_utils.h" 5 #include "net/quic/test_tools/crypto_test_utils.h"
6 6
7 #include "net/quic/core/crypto/crypto_server_config_protobuf.h" 7 #include "net/quic/core/crypto/crypto_server_config_protobuf.h"
8 #include "net/quic/core/quic_utils.h" 8 #include "net/quic/core/quic_utils.h"
9 #include "net/quic/test_tools/mock_clock.h" 9 #include "net/quic/test_tools/mock_clock.h"
10 #include "net/test/gtest_util.h" 10 #include "net/test/gtest_util.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 QuicCryptoServerConfig::ConfigOptions old_config_options; 116 QuicCryptoServerConfig::ConfigOptions old_config_options;
117 old_config_options.id = "old-config-id"; 117 old_config_options.id = "old-config-id";
118 delete crypto_config.AddDefaultConfig(QuicRandom::GetInstance(), &clock, 118 delete crypto_config.AddDefaultConfig(QuicRandom::GetInstance(), &clock,
119 old_config_options); 119 old_config_options);
120 QuicCryptoServerConfig::ConfigOptions new_config_options; 120 QuicCryptoServerConfig::ConfigOptions new_config_options;
121 std::unique_ptr<QuicServerConfigProtobuf> primary_config( 121 std::unique_ptr<QuicServerConfigProtobuf> primary_config(
122 crypto_config.GenerateConfig(QuicRandom::GetInstance(), &clock, 122 crypto_config.GenerateConfig(QuicRandom::GetInstance(), &clock,
123 new_config_options)); 123 new_config_options));
124 primary_config->set_primary_time(clock.WallNow().ToUNIXSeconds()); 124 primary_config->set_primary_time(clock.WallNow().ToUNIXSeconds());
125 std::unique_ptr<CryptoHandshakeMessage> msg( 125 std::unique_ptr<CryptoHandshakeMessage> msg(
126 crypto_config.AddConfig(primary_config.get(), clock.WallNow())); 126 crypto_config.AddConfig(std::move(primary_config), clock.WallNow()));
127 StringPiece orbit; 127 StringPiece orbit;
128 ASSERT_TRUE(msg->GetStringPiece(kORBT, &orbit)); 128 ASSERT_TRUE(msg->GetStringPiece(kORBT, &orbit));
129 string nonce; 129 string nonce;
130 CryptoUtils::GenerateNonce( 130 CryptoUtils::GenerateNonce(
131 clock.WallNow(), QuicRandom::GetInstance(), 131 clock.WallNow(), QuicRandom::GetInstance(),
132 StringPiece(reinterpret_cast<const char*>(orbit.data()), 132 StringPiece(reinterpret_cast<const char*>(orbit.data()),
133 sizeof(orbit.size())), 133 sizeof(orbit.size())),
134 &nonce); 134 &nonce);
135 string nonce_hex = "#" + QuicUtils::HexEncode(nonce); 135 string nonce_hex = "#" + QuicUtils::HexEncode(nonce);
136 136
(...skipping 23 matching lines...) Expand all
160 // Verify that full_chlo can pass crypto_config's verification. 160 // Verify that full_chlo can pass crypto_config's verification.
161 ShloVerifier shlo_verifier(&crypto_config, server_ip, client_addr, &clock, 161 ShloVerifier shlo_verifier(&crypto_config, server_ip, client_addr, &clock,
162 &proof, &compressed_certs_cache); 162 &proof, &compressed_certs_cache);
163 crypto_config.ValidateClientHello( 163 crypto_config.ValidateClientHello(
164 full_chlo, client_addr.address(), server_ip, version, &clock, &proof, 164 full_chlo, client_addr.address(), server_ip, version, &clock, &proof,
165 shlo_verifier.GetValidateClientHelloCallback()); 165 shlo_verifier.GetValidateClientHelloCallback());
166 } 166 }
167 167
168 } // namespace test 168 } // namespace test
169 } // namespace net 169 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/crypto_test_utils.cc ('k') | net/quic/test_tools/simple_quic_framer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698