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 "base/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
8 #include "net/quic/crypto/crypto_handshake.h" | 8 #include "net/quic/crypto/crypto_handshake.h" |
9 #include "net/quic/crypto/crypto_server_config.h" | 9 #include "net/quic/crypto/crypto_server_config.h" |
10 #include "net/quic/crypto/quic_decrypter.h" | 10 #include "net/quic/crypto/quic_decrypter.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 CHECK(ParseIPLiteralToNumber("192.0.2.33", &ip)); | 165 CHECK(ParseIPLiteralToNumber("192.0.2.33", &ip)); |
166 IPEndPoint addr = IPEndPoint(ip, 1); | 166 IPEndPoint addr = IPEndPoint(ip, 1); |
167 PacketSavingConnection* client_conn = | 167 PacketSavingConnection* client_conn = |
168 new PacketSavingConnection(guid, addr, false); | 168 new PacketSavingConnection(guid, addr, false); |
169 TestSession client_session(client_conn, true); | 169 TestSession client_session(client_conn, true); |
170 QuicConfig config; | 170 QuicConfig config; |
171 QuicCryptoClientConfig crypto_config; | 171 QuicCryptoClientConfig crypto_config; |
172 | 172 |
173 config.SetDefaults(); | 173 config.SetDefaults(); |
174 crypto_config.SetDefaults(); | 174 crypto_config.SetDefaults(); |
| 175 // TODO(rtenneti): Enable testing of ProofVerifier. |
| 176 // crypto_config.SetProofVerifier(ProofVerifierForTesting()); |
175 QuicCryptoClientStream client("test.example.com", config, &client_session, | 177 QuicCryptoClientStream client("test.example.com", config, &client_session, |
176 &crypto_config); | 178 &crypto_config); |
177 | 179 |
178 CHECK(client.CryptoConnect()); | 180 CHECK(client.CryptoConnect()); |
179 CHECK_EQ(1u, client_conn->packets_.size()); | 181 CHECK_EQ(1u, client_conn->packets_.size()); |
180 | 182 |
181 CommunicateHandshakeMessages(client_conn, &client, server_conn, server); | 183 CommunicateHandshakeMessages(client_conn, &client, server_conn, server); |
182 | 184 |
183 CompareClientAndServerKeys(&client, server); | 185 CompareClientAndServerKeys(&client, server); |
184 | 186 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 client_decrypter_key.data(), | 249 client_decrypter_key.data(), |
248 client_decrypter_key.length()); | 250 client_decrypter_key.length()); |
249 CompareCharArraysWithHexError("server write IV", | 251 CompareCharArraysWithHexError("server write IV", |
250 server_encrypter_iv.data(), | 252 server_encrypter_iv.data(), |
251 server_encrypter_iv.length(), | 253 server_encrypter_iv.length(), |
252 client_decrypter_iv.data(), | 254 client_decrypter_iv.data(), |
253 client_decrypter_iv.length()); | 255 client_decrypter_iv.length()); |
254 } | 256 } |
255 } // namespace test | 257 } // namespace test |
256 } // namespace net | 258 } // namespace net |
OLD | NEW |