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/quic_crypto_server_stream.h" | 5 #include "net/quic/quic_crypto_server_stream.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 new TestSession(server_conn, config_, true)); | 167 new TestSession(server_conn, config_, true)); |
168 scoped_ptr<QuicCryptoServerStream> server( | 168 scoped_ptr<QuicCryptoServerStream> server( |
169 new QuicCryptoServerStream(crypto_config_, server_session.get())); | 169 new QuicCryptoServerStream(crypto_config_, server_session.get())); |
170 server_session->SetCryptoStream(server.get()); | 170 server_session->SetCryptoStream(server.get()); |
171 | 171 |
172 CryptoTestUtils::CommunicateHandshakeMessages( | 172 CryptoTestUtils::CommunicateHandshakeMessages( |
173 client_conn, client.get(), server_conn, server.get()); | 173 client_conn, client.get(), server_conn, server.get()); |
174 EXPECT_EQ(2, client->num_sent_client_hellos()); | 174 EXPECT_EQ(2, client->num_sent_client_hellos()); |
175 | 175 |
176 // Now do another handshake, hopefully in 0-RTT. | 176 // Now do another handshake, hopefully in 0-RTT. |
177 LOG(INFO) << "Resetting for 0-RTT handshake attempt"; | 177 VLOG(0) << "Resetting for 0-RTT handshake attempt"; |
178 | 178 |
179 client_conn = new PacketSavingConnection(guid, addr, false); | 179 client_conn = new PacketSavingConnection(guid, addr, false); |
180 server_conn = new PacketSavingConnection(guid, addr, false); | 180 server_conn = new PacketSavingConnection(guid, addr, false); |
181 // We need to advance time past the strike-server window so that it's | 181 // We need to advance time past the strike-server window so that it's |
182 // authoritative in this time span. | 182 // authoritative in this time span. |
183 client_conn->AdvanceTime(QuicTime::Delta::FromSeconds(102000)); | 183 client_conn->AdvanceTime(QuicTime::Delta::FromSeconds(102000)); |
184 server_conn->AdvanceTime(QuicTime::Delta::FromSeconds(102000)); | 184 server_conn->AdvanceTime(QuicTime::Delta::FromSeconds(102000)); |
185 | 185 |
186 // This causes the client's nonce to be different and thus stops the | 186 // This causes the client's nonce to be different and thus stops the |
187 // strike-register from rejecting the repeated nonce. | 187 // strike-register from rejecting the repeated nonce. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // CompleteCryptoHandshake verifies | 266 // CompleteCryptoHandshake verifies |
267 // stream_.crypto_negotiated_params().channel_id is correct. | 267 // stream_.crypto_negotiated_params().channel_id is correct. |
268 EXPECT_EQ(2, CompleteCryptoHandshake()); | 268 EXPECT_EQ(2, CompleteCryptoHandshake()); |
269 EXPECT_TRUE(stream_.encryption_established()); | 269 EXPECT_TRUE(stream_.encryption_established()); |
270 EXPECT_TRUE(stream_.handshake_confirmed()); | 270 EXPECT_TRUE(stream_.handshake_confirmed()); |
271 } | 271 } |
272 | 272 |
273 } // namespace | 273 } // namespace |
274 } // namespace test | 274 } // namespace test |
275 } // namespace net | 275 } // namespace net |
OLD | NEW |