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 "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" |
8 #include "net/quic/crypto/crypto_framer.h" | 8 #include "net/quic/crypto/crypto_framer.h" |
9 #include "net/quic/crypto/crypto_handshake_message.h" | 9 #include "net/quic/crypto/crypto_handshake_message.h" |
10 #include "net/quic/crypto/quic_decrypter.h" | 10 #include "net/quic/crypto/quic_decrypter.h" |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 } | 641 } |
642 | 642 |
643 visitor_->OnPacketComplete(); | 643 visitor_->OnPacketComplete(); |
644 return true; | 644 return true; |
645 } | 645 } |
646 | 646 |
647 bool QuicFramer::ProcessPublicResetPacket( | 647 bool QuicFramer::ProcessPublicResetPacket( |
648 const QuicPacketPublicHeader& public_header) { | 648 const QuicPacketPublicHeader& public_header) { |
649 QuicPublicResetPacket packet(public_header); | 649 QuicPublicResetPacket packet(public_header); |
650 | 650 |
651 if (reader_->BytesRemaining() <= | 651 if (public_header.sequence_number_length == PACKET_6BYTE_SEQUENCE_NUMBER) { |
652 kPublicResetNonceSize + PACKET_6BYTE_SEQUENCE_NUMBER) { | 652 // An old-style public reset packet has the |
653 // An old-style public reset packet. | 653 // PACKET_PUBLIC_FLAGS_6BYTE_SEQUENCE bits set in the public flags. |
654 // TODO(wtc): remove this when we drop support for QUIC_VERSION_13. | 654 // TODO(wtc): remove this when we drop support for QUIC_VERSION_13. |
655 if (!reader_->ReadUInt64(&packet.nonce_proof)) { | 655 if (!reader_->ReadUInt64(&packet.nonce_proof)) { |
656 set_detailed_error("Unable to read nonce proof."); | 656 set_detailed_error("Unable to read nonce proof."); |
657 return RaiseError(QUIC_INVALID_PUBLIC_RST_PACKET); | 657 return RaiseError(QUIC_INVALID_PUBLIC_RST_PACKET); |
658 } | 658 } |
659 | 659 |
660 if (!reader_->ReadUInt48(&packet.rejected_sequence_number)) { | 660 if (!reader_->ReadUInt48(&packet.rejected_sequence_number)) { |
661 set_detailed_error("Unable to read rejected sequence number."); | 661 set_detailed_error("Unable to read rejected sequence number."); |
662 return RaiseError(QUIC_INVALID_PUBLIC_RST_PACKET); | 662 return RaiseError(QUIC_INVALID_PUBLIC_RST_PACKET); |
663 } | 663 } |
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2257 | 2257 |
2258 bool QuicFramer::RaiseError(QuicErrorCode error) { | 2258 bool QuicFramer::RaiseError(QuicErrorCode error) { |
2259 DVLOG(1) << "Error detail: " << detailed_error_; | 2259 DVLOG(1) << "Error detail: " << detailed_error_; |
2260 set_error(error); | 2260 set_error(error); |
2261 visitor_->OnError(this); | 2261 visitor_->OnError(this); |
2262 reader_.reset(NULL); | 2262 reader_.reset(NULL); |
2263 return false; | 2263 return false; |
2264 } | 2264 } |
2265 | 2265 |
2266 } // namespace net | 2266 } // namespace net |
OLD | NEW |