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_framer.h" | 5 #include "net/quic/quic_framer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 // Index into the nonce proof of the public reset packet. | 97 // Index into the nonce proof of the public reset packet. |
98 // Public resets always have full guids. | 98 // Public resets always have full guids. |
99 const size_t kPublicResetPacketNonceProofOffset = | 99 const size_t kPublicResetPacketNonceProofOffset = |
100 kGuidOffset + PACKET_8BYTE_GUID; | 100 kGuidOffset + PACKET_8BYTE_GUID; |
101 | 101 |
102 // Index into the rejected sequence number of the public reset packet. | 102 // Index into the rejected sequence number of the public reset packet. |
103 const size_t kPublicResetPacketRejectedSequenceNumberOffset = | 103 const size_t kPublicResetPacketRejectedSequenceNumberOffset = |
104 kPublicResetPacketNonceProofOffset + kPublicResetNonceSize; | 104 kPublicResetPacketNonceProofOffset + kPublicResetNonceSize; |
105 | 105 |
| 106 // TODO(wtc): remove this when we drop support for QUIC_VERSION_13. |
| 107 // Size of the old-style public reset packet. |
| 108 const size_t kPublicResetPacketOldSize = |
| 109 kPublicResetPacketRejectedSequenceNumberOffset + |
| 110 PACKET_6BYTE_SEQUENCE_NUMBER; |
| 111 |
106 class TestEncrypter : public QuicEncrypter { | 112 class TestEncrypter : public QuicEncrypter { |
107 public: | 113 public: |
108 virtual ~TestEncrypter() {} | 114 virtual ~TestEncrypter() {} |
109 virtual bool SetKey(StringPiece key) OVERRIDE { | 115 virtual bool SetKey(StringPiece key) OVERRIDE { |
110 return true; | 116 return true; |
111 } | 117 } |
112 virtual bool SetNoncePrefix(StringPiece nonce_prefix) OVERRIDE { | 118 virtual bool SetNoncePrefix(StringPiece nonce_prefix) OVERRIDE { |
113 return true; | 119 return true; |
114 } | 120 } |
115 virtual bool Encrypt(StringPiece nonce, | 121 virtual bool Encrypt(StringPiece nonce, |
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2275 packet, | 2281 packet, |
2276 i + GetPacketHeaderSize(PACKET_8BYTE_GUID, !kIncludeVersion, | 2282 i + GetPacketHeaderSize(PACKET_8BYTE_GUID, !kIncludeVersion, |
2277 PACKET_6BYTE_SEQUENCE_NUMBER, NOT_IN_FEC_GROUP), | 2283 PACKET_6BYTE_SEQUENCE_NUMBER, NOT_IN_FEC_GROUP), |
2278 expected_error, QUIC_INVALID_GOAWAY_DATA); | 2284 expected_error, QUIC_INVALID_GOAWAY_DATA); |
2279 } | 2285 } |
2280 } | 2286 } |
2281 | 2287 |
2282 TEST_P(QuicFramerTest, PublicResetPacket) { | 2288 TEST_P(QuicFramerTest, PublicResetPacket) { |
2283 unsigned char packet[] = { | 2289 unsigned char packet[] = { |
2284 // public flags (public reset, 8 byte guid) | 2290 // public flags (public reset, 8 byte guid) |
| 2291 0x0E, |
| 2292 // guid |
| 2293 0x10, 0x32, 0x54, 0x76, |
| 2294 0x98, 0xBA, 0xDC, 0xFE, |
| 2295 // message tag (kPRST) |
| 2296 'P', 'R', 'S', 'T', |
| 2297 // num_entries (2) + padding |
| 2298 0x02, 0x00, 0x00, 0x00, |
| 2299 // tag kRNON |
| 2300 'R', 'N', 'O', 'N', |
| 2301 // end offset 8 |
| 2302 0x08, 0x00, 0x00, 0x00, |
| 2303 // tag kRSEQ |
| 2304 'R', 'S', 'E', 'Q', |
| 2305 // end offset 16 |
| 2306 0x10, 0x00, 0x00, 0x00, |
| 2307 // nonce proof |
| 2308 0x89, 0x67, 0x45, 0x23, |
| 2309 0x01, 0xEF, 0xCD, 0xAB, |
| 2310 // rejected sequence number |
| 2311 0xBC, 0x9A, 0x78, 0x56, |
| 2312 0x34, 0x12, 0x00, 0x00, |
| 2313 }; |
| 2314 |
| 2315 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); |
| 2316 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); |
| 2317 ASSERT_EQ(QUIC_NO_ERROR, framer_.error()); |
| 2318 ASSERT_TRUE(visitor_.public_reset_packet_.get()); |
| 2319 EXPECT_EQ(GG_UINT64_C(0xFEDCBA9876543210), |
| 2320 visitor_.public_reset_packet_->public_header.guid); |
| 2321 EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag); |
| 2322 EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag); |
| 2323 EXPECT_EQ(GG_UINT64_C(0xABCDEF0123456789), |
| 2324 visitor_.public_reset_packet_->nonce_proof); |
| 2325 EXPECT_EQ(GG_UINT64_C(0x123456789ABC), |
| 2326 visitor_.public_reset_packet_->rejected_sequence_number); |
| 2327 EXPECT_TRUE( |
| 2328 visitor_.public_reset_packet_->client_address.address().empty()); |
| 2329 |
| 2330 // Now test framing boundaries |
| 2331 for (size_t i = 0; i < arraysize(packet); ++i) { |
| 2332 string expected_error; |
| 2333 DLOG(INFO) << "iteration: " << i; |
| 2334 if (i < kGuidOffset) { |
| 2335 expected_error = "Unable to read public flags."; |
| 2336 CheckProcessingFails(packet, i, expected_error, |
| 2337 QUIC_INVALID_PACKET_HEADER); |
| 2338 } else if (i < kPublicResetPacketNonceProofOffset) { |
| 2339 expected_error = "Unable to read GUID."; |
| 2340 CheckProcessingFails(packet, i, expected_error, |
| 2341 QUIC_INVALID_PACKET_HEADER); |
| 2342 } else if (i < kPublicResetPacketRejectedSequenceNumberOffset) { |
| 2343 expected_error = "Unable to read nonce proof."; |
| 2344 CheckProcessingFails(packet, i, expected_error, |
| 2345 QUIC_INVALID_PUBLIC_RST_PACKET); |
| 2346 } else if (i < kPublicResetPacketOldSize) { |
| 2347 expected_error = "Unable to read rejected sequence number."; |
| 2348 CheckProcessingFails(packet, i, expected_error, |
| 2349 QUIC_INVALID_PUBLIC_RST_PACKET); |
| 2350 } else if (i == kPublicResetPacketOldSize) { |
| 2351 // This looks like an old public reset packet, so there won't be an |
| 2352 // error. |
| 2353 } else { |
| 2354 expected_error = "Unable to read reset message."; |
| 2355 CheckProcessingFails(packet, i, expected_error, |
| 2356 QUIC_INVALID_PUBLIC_RST_PACKET); |
| 2357 } |
| 2358 } |
| 2359 } |
| 2360 |
| 2361 TEST_P(QuicFramerTest, PublicResetPacketWithClientAddress) { |
| 2362 unsigned char packet[] = { |
| 2363 // public flags (public reset, 8 byte guid) |
| 2364 0x0E, |
| 2365 // guid |
| 2366 0x10, 0x32, 0x54, 0x76, |
| 2367 0x98, 0xBA, 0xDC, 0xFE, |
| 2368 // message tag (kPRST) |
| 2369 'P', 'R', 'S', 'T', |
| 2370 // num_entries (3) + padding |
| 2371 0x03, 0x00, 0x00, 0x00, |
| 2372 // tag kRNON |
| 2373 'R', 'N', 'O', 'N', |
| 2374 // end offset 8 |
| 2375 0x08, 0x00, 0x00, 0x00, |
| 2376 // tag kRSEQ |
| 2377 'R', 'S', 'E', 'Q', |
| 2378 // end offset 16 |
| 2379 0x10, 0x00, 0x00, 0x00, |
| 2380 // tag kCADR |
| 2381 'C', 'A', 'D', 'R', |
| 2382 // end offset 24 |
| 2383 0x18, 0x00, 0x00, 0x00, |
| 2384 // nonce proof |
| 2385 0x89, 0x67, 0x45, 0x23, |
| 2386 0x01, 0xEF, 0xCD, 0xAB, |
| 2387 // rejected sequence number |
| 2388 0xBC, 0x9A, 0x78, 0x56, |
| 2389 0x34, 0x12, 0x00, 0x00, |
| 2390 // client address: 4.31.198.44:443 |
| 2391 0x02, 0x00, |
| 2392 0x04, 0x1F, 0xC6, 0x2C, |
| 2393 0xBB, 0x01, |
| 2394 }; |
| 2395 |
| 2396 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); |
| 2397 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); |
| 2398 ASSERT_EQ(QUIC_NO_ERROR, framer_.error()); |
| 2399 ASSERT_TRUE(visitor_.public_reset_packet_.get()); |
| 2400 EXPECT_EQ(GG_UINT64_C(0xFEDCBA9876543210), |
| 2401 visitor_.public_reset_packet_->public_header.guid); |
| 2402 EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag); |
| 2403 EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag); |
| 2404 EXPECT_EQ(GG_UINT64_C(0xABCDEF0123456789), |
| 2405 visitor_.public_reset_packet_->nonce_proof); |
| 2406 EXPECT_EQ(GG_UINT64_C(0x123456789ABC), |
| 2407 visitor_.public_reset_packet_->rejected_sequence_number); |
| 2408 EXPECT_EQ("4.31.198.44", |
| 2409 IPAddressToString(visitor_.public_reset_packet_-> |
| 2410 client_address.address())); |
| 2411 EXPECT_EQ(443, visitor_.public_reset_packet_->client_address.port()); |
| 2412 |
| 2413 // Now test framing boundaries |
| 2414 for (size_t i = 0; i < arraysize(packet); ++i) { |
| 2415 string expected_error; |
| 2416 DLOG(INFO) << "iteration: " << i; |
| 2417 if (i < kGuidOffset) { |
| 2418 expected_error = "Unable to read public flags."; |
| 2419 CheckProcessingFails(packet, i, expected_error, |
| 2420 QUIC_INVALID_PACKET_HEADER); |
| 2421 } else if (i < kPublicResetPacketNonceProofOffset) { |
| 2422 expected_error = "Unable to read GUID."; |
| 2423 CheckProcessingFails(packet, i, expected_error, |
| 2424 QUIC_INVALID_PACKET_HEADER); |
| 2425 } else if (i < kPublicResetPacketRejectedSequenceNumberOffset) { |
| 2426 expected_error = "Unable to read nonce proof."; |
| 2427 CheckProcessingFails(packet, i, expected_error, |
| 2428 QUIC_INVALID_PUBLIC_RST_PACKET); |
| 2429 } else if (i < kPublicResetPacketOldSize) { |
| 2430 expected_error = "Unable to read rejected sequence number."; |
| 2431 CheckProcessingFails(packet, i, expected_error, |
| 2432 QUIC_INVALID_PUBLIC_RST_PACKET); |
| 2433 } else if (i == kPublicResetPacketOldSize) { |
| 2434 // This looks like an old public reset packet, so there won't be an |
| 2435 // error. |
| 2436 } else { |
| 2437 expected_error = "Unable to read reset message."; |
| 2438 CheckProcessingFails(packet, i, expected_error, |
| 2439 QUIC_INVALID_PUBLIC_RST_PACKET); |
| 2440 } |
| 2441 } |
| 2442 } |
| 2443 |
| 2444 // TODO(wtc): remove this test when we drop support for QUIC_VERSION_13. |
| 2445 TEST_P(QuicFramerTest, PublicResetPacketOld) { |
| 2446 unsigned char packet[] = { |
| 2447 // public flags (public reset, 8 byte guid) |
2285 0x3E, | 2448 0x3E, |
2286 // guid | 2449 // guid |
2287 0x10, 0x32, 0x54, 0x76, | 2450 0x10, 0x32, 0x54, 0x76, |
2288 0x98, 0xBA, 0xDC, 0xFE, | 2451 0x98, 0xBA, 0xDC, 0xFE, |
2289 // nonce proof | 2452 // nonce proof |
2290 0x89, 0x67, 0x45, 0x23, | 2453 0x89, 0x67, 0x45, 0x23, |
2291 0x01, 0xEF, 0xCD, 0xAB, | 2454 0x01, 0xEF, 0xCD, 0xAB, |
2292 // rejected sequence number | 2455 // rejected sequence number |
2293 0xBC, 0x9A, 0x78, 0x56, | 2456 0xBC, 0x9A, 0x78, 0x56, |
2294 0x34, 0x12, | 2457 0x34, 0x12, |
2295 }; | 2458 }; |
2296 | 2459 |
2297 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); | 2460 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); |
2298 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); | 2461 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); |
2299 ASSERT_EQ(QUIC_NO_ERROR, framer_.error()); | 2462 ASSERT_EQ(QUIC_NO_ERROR, framer_.error()); |
2300 ASSERT_TRUE(visitor_.public_reset_packet_.get()); | 2463 ASSERT_TRUE(visitor_.public_reset_packet_.get()); |
2301 EXPECT_EQ(GG_UINT64_C(0xFEDCBA9876543210), | 2464 EXPECT_EQ(GG_UINT64_C(0xFEDCBA9876543210), |
2302 visitor_.public_reset_packet_->public_header.guid); | 2465 visitor_.public_reset_packet_->public_header.guid); |
2303 EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag); | 2466 EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag); |
2304 EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag); | 2467 EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag); |
2305 EXPECT_EQ(GG_UINT64_C(0xABCDEF0123456789), | 2468 EXPECT_EQ(GG_UINT64_C(0xABCDEF0123456789), |
2306 visitor_.public_reset_packet_->nonce_proof); | 2469 visitor_.public_reset_packet_->nonce_proof); |
2307 EXPECT_EQ(GG_UINT64_C(0x123456789ABC), | 2470 EXPECT_EQ(GG_UINT64_C(0x123456789ABC), |
2308 visitor_.public_reset_packet_->rejected_sequence_number); | 2471 visitor_.public_reset_packet_->rejected_sequence_number); |
| 2472 EXPECT_TRUE( |
| 2473 visitor_.public_reset_packet_->client_address.address().empty()); |
2309 | 2474 |
2310 // Now test framing boundaries | 2475 // Now test framing boundaries |
2311 for (size_t i = 0; i < GetPublicResetPacketSize(); ++i) { | 2476 for (size_t i = 0; i < arraysize(packet); ++i) { |
2312 string expected_error; | 2477 string expected_error; |
2313 DVLOG(1) << "iteration: " << i; | 2478 DVLOG(1) << "iteration: " << i; |
2314 if (i < kGuidOffset) { | 2479 if (i < kGuidOffset) { |
2315 expected_error = "Unable to read public flags."; | 2480 expected_error = "Unable to read public flags."; |
2316 CheckProcessingFails(packet, i, expected_error, | 2481 CheckProcessingFails(packet, i, expected_error, |
2317 QUIC_INVALID_PACKET_HEADER); | 2482 QUIC_INVALID_PACKET_HEADER); |
2318 } else if (i < kPublicResetPacketNonceProofOffset) { | 2483 } else if (i < kPublicResetPacketNonceProofOffset) { |
2319 expected_error = "Unable to read GUID."; | 2484 expected_error = "Unable to read GUID."; |
2320 CheckProcessingFails(packet, i, expected_error, | 2485 CheckProcessingFails(packet, i, expected_error, |
2321 QUIC_INVALID_PACKET_HEADER); | 2486 QUIC_INVALID_PACKET_HEADER); |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2702 } | 2867 } |
2703 | 2868 |
2704 TEST_P(QuicFramerTest, BuildVersionNegotiationPacket) { | 2869 TEST_P(QuicFramerTest, BuildVersionNegotiationPacket) { |
2705 QuicPacketPublicHeader header; | 2870 QuicPacketPublicHeader header; |
2706 header.guid = GG_UINT64_C(0xFEDCBA9876543210); | 2871 header.guid = GG_UINT64_C(0xFEDCBA9876543210); |
2707 header.reset_flag = false; | 2872 header.reset_flag = false; |
2708 header.version_flag = true; | 2873 header.version_flag = true; |
2709 | 2874 |
2710 unsigned char packet[] = { | 2875 unsigned char packet[] = { |
2711 // public flags (version, 8 byte guid) | 2876 // public flags (version, 8 byte guid) |
2712 0x3D, | 2877 0x0D, |
2713 // guid | 2878 // guid |
2714 0x10, 0x32, 0x54, 0x76, | 2879 0x10, 0x32, 0x54, 0x76, |
2715 0x98, 0xBA, 0xDC, 0xFE, | 2880 0x98, 0xBA, 0xDC, 0xFE, |
2716 // version tag | 2881 // version tag |
2717 'Q', '0', GetQuicVersionDigitTens(), GetQuicVersionDigitOnes(), | 2882 'Q', '0', GetQuicVersionDigitTens(), GetQuicVersionDigitOnes(), |
2718 }; | 2883 }; |
2719 | 2884 |
2720 QuicVersionVector versions; | 2885 QuicVersionVector versions; |
2721 versions.push_back(GetParam()); | 2886 versions.push_back(GetParam()); |
2722 scoped_ptr<QuicEncryptedPacket> data( | 2887 scoped_ptr<QuicEncryptedPacket> data( |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3148 TEST_P(QuicFramerTest, BuildPublicResetPacket) { | 3313 TEST_P(QuicFramerTest, BuildPublicResetPacket) { |
3149 QuicPublicResetPacket reset_packet; | 3314 QuicPublicResetPacket reset_packet; |
3150 reset_packet.public_header.guid = GG_UINT64_C(0xFEDCBA9876543210); | 3315 reset_packet.public_header.guid = GG_UINT64_C(0xFEDCBA9876543210); |
3151 reset_packet.public_header.reset_flag = true; | 3316 reset_packet.public_header.reset_flag = true; |
3152 reset_packet.public_header.version_flag = false; | 3317 reset_packet.public_header.version_flag = false; |
3153 reset_packet.rejected_sequence_number = GG_UINT64_C(0x123456789ABC); | 3318 reset_packet.rejected_sequence_number = GG_UINT64_C(0x123456789ABC); |
3154 reset_packet.nonce_proof = GG_UINT64_C(0xABCDEF0123456789); | 3319 reset_packet.nonce_proof = GG_UINT64_C(0xABCDEF0123456789); |
3155 | 3320 |
3156 unsigned char packet[] = { | 3321 unsigned char packet[] = { |
3157 // public flags (public reset, 8 byte GUID) | 3322 // public flags (public reset, 8 byte GUID) |
3158 0x3E, | 3323 0x0E, |
3159 // guid | 3324 // guid |
3160 0x10, 0x32, 0x54, 0x76, | 3325 0x10, 0x32, 0x54, 0x76, |
3161 0x98, 0xBA, 0xDC, 0xFE, | 3326 0x98, 0xBA, 0xDC, 0xFE, |
| 3327 // message tag (kPRST) |
| 3328 'P', 'R', 'S', 'T', |
| 3329 // num_entries (2) + padding |
| 3330 0x02, 0x00, 0x00, 0x00, |
| 3331 // tag kRNON |
| 3332 'R', 'N', 'O', 'N', |
| 3333 // end offset 8 |
| 3334 0x08, 0x00, 0x00, 0x00, |
| 3335 // tag kRSEQ |
| 3336 'R', 'S', 'E', 'Q', |
| 3337 // end offset 16 |
| 3338 0x10, 0x00, 0x00, 0x00, |
3162 // nonce proof | 3339 // nonce proof |
3163 0x89, 0x67, 0x45, 0x23, | 3340 0x89, 0x67, 0x45, 0x23, |
3164 0x01, 0xEF, 0xCD, 0xAB, | 3341 0x01, 0xEF, 0xCD, 0xAB, |
3165 // rejected sequence number | 3342 // rejected sequence number |
3166 0xBC, 0x9A, 0x78, 0x56, | 3343 0xBC, 0x9A, 0x78, 0x56, |
| 3344 0x34, 0x12, 0x00, 0x00, |
| 3345 }; |
| 3346 |
| 3347 scoped_ptr<QuicEncryptedPacket> data( |
| 3348 framer_.BuildPublicResetPacket(reset_packet)); |
| 3349 ASSERT_TRUE(data != NULL); |
| 3350 |
| 3351 test::CompareCharArraysWithHexError("constructed packet", |
| 3352 data->data(), data->length(), |
| 3353 AsChars(packet), arraysize(packet)); |
| 3354 } |
| 3355 |
| 3356 TEST_P(QuicFramerTest, BuildPublicResetPacketWithClientAddress) { |
| 3357 QuicPublicResetPacket reset_packet; |
| 3358 reset_packet.public_header.guid = GG_UINT64_C(0xFEDCBA9876543210); |
| 3359 reset_packet.public_header.reset_flag = true; |
| 3360 reset_packet.public_header.version_flag = false; |
| 3361 reset_packet.rejected_sequence_number = GG_UINT64_C(0x123456789ABC); |
| 3362 reset_packet.nonce_proof = GG_UINT64_C(0xABCDEF0123456789); |
| 3363 reset_packet.client_address = IPEndPoint(Loopback4(), 0x1234); |
| 3364 |
| 3365 unsigned char packet[] = { |
| 3366 // public flags (public reset, 8 byte GUID) |
| 3367 0x0E, |
| 3368 // guid |
| 3369 0x10, 0x32, 0x54, 0x76, |
| 3370 0x98, 0xBA, 0xDC, 0xFE, |
| 3371 // message tag (kPRST) |
| 3372 'P', 'R', 'S', 'T', |
| 3373 // num_entries (3) + padding |
| 3374 0x03, 0x00, 0x00, 0x00, |
| 3375 // tag kRNON |
| 3376 'R', 'N', 'O', 'N', |
| 3377 // end offset 8 |
| 3378 0x08, 0x00, 0x00, 0x00, |
| 3379 // tag kRSEQ |
| 3380 'R', 'S', 'E', 'Q', |
| 3381 // end offset 16 |
| 3382 0x10, 0x00, 0x00, 0x00, |
| 3383 // tag kCADR |
| 3384 'C', 'A', 'D', 'R', |
| 3385 // end offset 24 |
| 3386 0x18, 0x00, 0x00, 0x00, |
| 3387 // nonce proof |
| 3388 0x89, 0x67, 0x45, 0x23, |
| 3389 0x01, 0xEF, 0xCD, 0xAB, |
| 3390 // rejected sequence number |
| 3391 0xBC, 0x9A, 0x78, 0x56, |
| 3392 0x34, 0x12, 0x00, 0x00, |
| 3393 // client address |
| 3394 0x02, 0x00, |
| 3395 0x7F, 0x00, 0x00, 0x01, |
3167 0x34, 0x12, | 3396 0x34, 0x12, |
3168 }; | 3397 }; |
3169 | 3398 |
3170 scoped_ptr<QuicEncryptedPacket> data( | 3399 scoped_ptr<QuicEncryptedPacket> data( |
3171 framer_.BuildPublicResetPacket(reset_packet)); | 3400 framer_.BuildPublicResetPacket(reset_packet)); |
3172 ASSERT_TRUE(data != NULL); | 3401 ASSERT_TRUE(data != NULL); |
3173 | 3402 |
3174 test::CompareCharArraysWithHexError("constructed packet", | 3403 test::CompareCharArraysWithHexError("constructed packet", |
3175 data->data(), data->length(), | 3404 data->data(), data->length(), |
3176 AsChars(packet), arraysize(packet)); | 3405 AsChars(packet), arraysize(packet)); |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3516 EXPECT_CALL(visitor, OnPacketComplete()); | 3745 EXPECT_CALL(visitor, OnPacketComplete()); |
3517 EXPECT_CALL(visitor, OnUnauthenticatedPublicHeader(_)).WillOnce(Return(true)); | 3746 EXPECT_CALL(visitor, OnUnauthenticatedPublicHeader(_)).WillOnce(Return(true)); |
3518 | 3747 |
3519 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); | 3748 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); |
3520 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); | 3749 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); |
3521 EXPECT_EQ(QUIC_NO_ERROR, framer_.error()); | 3750 EXPECT_EQ(QUIC_NO_ERROR, framer_.error()); |
3522 } | 3751 } |
3523 | 3752 |
3524 } // namespace test | 3753 } // namespace test |
3525 } // namespace net | 3754 } // namespace net |
OLD | NEW |