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

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

Issue 1765603002: Add QUIC 31 in which the server's proof covers both the static server config as well as a hash of t… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/test_tools/crypto_test_utils_chromium.cc » ('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/crypto/channel_id.h" 7 #include "net/quic/crypto/channel_id.h"
8 #include "net/quic/crypto/common_cert_set.h" 8 #include "net/quic/crypto/common_cert_set.h"
9 #include "net/quic/crypto/crypto_handshake.h" 9 #include "net/quic/crypto/crypto_handshake.h"
10 #include "net/quic/crypto/quic_crypto_server_config.h" 10 #include "net/quic/crypto/quic_crypto_server_config.h"
11 #include "net/quic/crypto/quic_decrypter.h" 11 #include "net/quic/crypto/quic_decrypter.h"
12 #include "net/quic/crypto/quic_encrypter.h" 12 #include "net/quic/crypto/quic_encrypter.h"
13 #include "net/quic/crypto/quic_random.h" 13 #include "net/quic/crypto/quic_random.h"
14 #include "net/quic/quic_clock.h" 14 #include "net/quic/quic_clock.h"
15 #include "net/quic/quic_crypto_client_stream.h" 15 #include "net/quic/quic_crypto_client_stream.h"
16 #include "net/quic/quic_crypto_server_stream.h" 16 #include "net/quic/quic_crypto_server_stream.h"
17 #include "net/quic/quic_crypto_stream.h" 17 #include "net/quic/quic_crypto_stream.h"
18 #include "net/quic/quic_server_id.h" 18 #include "net/quic/quic_server_id.h"
19 #include "net/quic/quic_utils.h"
19 #include "net/quic/test_tools/quic_connection_peer.h" 20 #include "net/quic/test_tools/quic_connection_peer.h"
20 #include "net/quic/test_tools/quic_framer_peer.h" 21 #include "net/quic/test_tools/quic_framer_peer.h"
21 #include "net/quic/test_tools/quic_test_utils.h" 22 #include "net/quic/test_tools/quic_test_utils.h"
22 #include "net/quic/test_tools/simple_quic_framer.h" 23 #include "net/quic/test_tools/simple_quic_framer.h"
23 24
24 using base::StringPiece; 25 using base::StringPiece;
25 using std::make_pair; 26 using std::make_pair;
26 using std::pair; 27 using std::pair;
27 using std::string; 28 using std::string;
28 using std::vector; 29 using std::vector;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 source = async_channel_id_source; 174 source = async_channel_id_source;
174 } 175 }
175 crypto_config.SetChannelIDSource(source); 176 crypto_config.SetChannelIDSource(source);
176 } 177 }
177 if (options.token_binding_enabled) { 178 if (options.token_binding_enabled) {
178 crypto_config.tb_key_params.push_back(kP256); 179 crypto_config.tb_key_params.push_back(kP256);
179 } 180 }
180 TestQuicSpdyClientSession client_session(client_conn, DefaultQuicConfig(), 181 TestQuicSpdyClientSession client_session(client_conn, DefaultQuicConfig(),
181 server_id, &crypto_config); 182 server_id, &crypto_config);
182 183
184 EXPECT_CALL(client_session, OnProofValid(testing::_))
185 .Times(testing::AnyNumber());
183 client_session.GetCryptoStream()->CryptoConnect(); 186 client_session.GetCryptoStream()->CryptoConnect();
184 CHECK_EQ(1u, client_conn->encrypted_packets_.size()); 187 CHECK_EQ(1u, client_conn->encrypted_packets_.size());
185 188
186 CommunicateHandshakeMessagesAndRunCallbacks( 189 CommunicateHandshakeMessagesAndRunCallbacks(
187 client_conn, client_session.GetCryptoStream(), server_conn, server, 190 client_conn, client_session.GetCryptoStream(), server_conn, server,
188 async_channel_id_source); 191 async_channel_id_source);
189 192
190 CompareClientAndServerKeys(client_session.GetCryptoStream(), server); 193 CompareClientAndServerKeys(client_session.GetCryptoStream(), server);
191 194
192 if (options.channel_id_enabled) { 195 if (options.channel_id_enabled) {
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 642
640 ASSERT_EQ(0u, crypto_framer.InputBytesRemaining()); 643 ASSERT_EQ(0u, crypto_framer.InputBytesRemaining());
641 644
642 for (const CryptoHandshakeMessage& message : crypto_visitor.messages()) { 645 for (const CryptoHandshakeMessage& message : crypto_visitor.messages()) {
643 dest_stream->OnHandshakeMessage(message); 646 dest_stream->OnHandshakeMessage(message);
644 } 647 }
645 } 648 }
646 649
647 } // namespace test 650 } // namespace test
648 } // namespace net 651 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/test_tools/crypto_test_utils_chromium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698