OLD | NEW |
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" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 client_session.config()->SetDefaults(); | 173 client_session.config()->SetDefaults(); |
174 crypto_config.SetDefaults(); | 174 crypto_config.SetDefaults(); |
175 // TODO(rtenneti): Enable testing of ProofVerifier. | 175 // TODO(rtenneti): Enable testing of ProofVerifier. |
176 // if (!options.dont_verify_certs) { | 176 // if (!options.dont_verify_certs) { |
177 // crypto_config.SetProofVerifier(ProofVerifierForTesting()); | 177 // crypto_config.SetProofVerifier(ProofVerifierForTesting()); |
178 // } | 178 // } |
179 if (options.channel_id_enabled) { | 179 if (options.channel_id_enabled) { |
180 crypto_config.SetChannelIDSigner(ChannelIDSignerForTesting()); | 180 crypto_config.SetChannelIDSigner(ChannelIDSignerForTesting()); |
181 } | 181 } |
182 QuicSessionKey server_key(kServerHostname, kServerPort, false, | 182 QuicSessionKey server_key(kServerHostname, kServerPort, false); |
183 kPrivacyModeDisabled); | |
184 QuicCryptoClientStream client(server_key, &client_session, NULL, | 183 QuicCryptoClientStream client(server_key, &client_session, NULL, |
185 &crypto_config); | 184 &crypto_config); |
186 client_session.SetCryptoStream(&client); | 185 client_session.SetCryptoStream(&client); |
187 | 186 |
188 CHECK(client.CryptoConnect()); | 187 CHECK(client.CryptoConnect()); |
189 CHECK_EQ(1u, client_conn->packets_.size()); | 188 CHECK_EQ(1u, client_conn->packets_.size()); |
190 | 189 |
191 CommunicateHandshakeMessages(client_conn, &client, server_conn, server); | 190 CommunicateHandshakeMessages(client_conn, &client, server_conn, server); |
192 | 191 |
193 CompareClientAndServerKeys(&client, server); | 192 CompareClientAndServerKeys(&client, server); |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 scoped_ptr<QuicData> bytes(CryptoFramer::ConstructHandshakeMessage(msg)); | 517 scoped_ptr<QuicData> bytes(CryptoFramer::ConstructHandshakeMessage(msg)); |
519 scoped_ptr<CryptoHandshakeMessage> parsed( | 518 scoped_ptr<CryptoHandshakeMessage> parsed( |
520 CryptoFramer::ParseMessage(bytes->AsStringPiece())); | 519 CryptoFramer::ParseMessage(bytes->AsStringPiece())); |
521 CHECK(parsed.get()); | 520 CHECK(parsed.get()); |
522 | 521 |
523 return *parsed; | 522 return *parsed; |
524 } | 523 } |
525 | 524 |
526 } // namespace test | 525 } // namespace test |
527 } // namespace net | 526 } // namespace net |
OLD | NEW |