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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 ChannelIDSource* source = ChannelIDSourceForTesting(); | 221 ChannelIDSource* source = ChannelIDSourceForTesting(); |
222 if (options.channel_id_source_async) { | 222 if (options.channel_id_source_async) { |
223 async_channel_id_source = new AsyncTestChannelIDSource(source); | 223 async_channel_id_source = new AsyncTestChannelIDSource(source); |
224 source = async_channel_id_source; | 224 source = async_channel_id_source; |
225 } | 225 } |
226 crypto_config.SetChannelIDSource(source); | 226 crypto_config.SetChannelIDSource(source); |
227 } | 227 } |
228 QuicServerId server_id(kServerHostname, kServerPort, is_https, | 228 QuicServerId server_id(kServerHostname, kServerPort, is_https, |
229 PRIVACY_MODE_DISABLED); | 229 PRIVACY_MODE_DISABLED); |
230 if (!options.dont_verify_certs) { | 230 if (!options.dont_verify_certs) { |
231 // TODO(wtc): replace this with ProofVerifierForTesting() when we have | 231 #if defined(USE_OPENSSL) |
232 // a working ProofSourceForTesting(). | 232 crypto_config.SetProofVerifier(ProofVerifierForTesting()); |
| 233 #else |
| 234 // TODO(rch): Implement a NSS proof source. |
233 crypto_config.SetProofVerifier(FakeProofVerifierForTesting()); | 235 crypto_config.SetProofVerifier(FakeProofVerifierForTesting()); |
| 236 #endif |
234 } | 237 } |
235 TestQuicSpdyClientSession client_session(client_conn, DefaultQuicConfig(), | 238 TestQuicSpdyClientSession client_session(client_conn, DefaultQuicConfig(), |
236 server_id, &crypto_config); | 239 server_id, &crypto_config); |
237 | 240 |
238 client_session.GetCryptoStream()->CryptoConnect(); | 241 client_session.GetCryptoStream()->CryptoConnect(); |
239 CHECK_EQ(1u, client_conn->encrypted_packets_.size()); | 242 CHECK_EQ(1u, client_conn->encrypted_packets_.size()); |
240 | 243 |
241 CommunicateHandshakeMessagesAndRunCallbacks( | 244 CommunicateHandshakeMessagesAndRunCallbacks( |
242 client_conn, client_session.GetCryptoStream(), server_conn, server, | 245 client_conn, client_session.GetCryptoStream(), server_conn, server, |
243 async_channel_id_source); | 246 async_channel_id_source); |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 scoped_ptr<CryptoHandshakeMessage> parsed( | 618 scoped_ptr<CryptoHandshakeMessage> parsed( |
616 CryptoFramer::ParseMessage(bytes->AsStringPiece())); | 619 CryptoFramer::ParseMessage(bytes->AsStringPiece())); |
617 CHECK(parsed.get()); | 620 CHECK(parsed.get()); |
618 | 621 |
619 va_end(ap); | 622 va_end(ap); |
620 return *parsed; | 623 return *parsed; |
621 } | 624 } |
622 | 625 |
623 } // namespace test | 626 } // namespace test |
624 } // namespace net | 627 } // namespace net |
OLD | NEW |