| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 bool QuicFramer::DecryptPayload(QuicDataReader* encrypted_reader, | 1697 bool QuicFramer::DecryptPayload(QuicDataReader* encrypted_reader, |
| 1698 const QuicPacketHeader& header, | 1698 const QuicPacketHeader& header, |
| 1699 const QuicEncryptedPacket& packet, | 1699 const QuicEncryptedPacket& packet, |
| 1700 char* decrypted_buffer, | 1700 char* decrypted_buffer, |
| 1701 size_t buffer_length, | 1701 size_t buffer_length, |
| 1702 size_t* decrypted_length) { | 1702 size_t* decrypted_length) { |
| 1703 StringPiece encrypted = encrypted_reader->ReadRemainingPayload(); | 1703 StringPiece encrypted = encrypted_reader->ReadRemainingPayload(); |
| 1704 DCHECK(decrypter_.get() != nullptr); | 1704 DCHECK(decrypter_.get() != nullptr); |
| 1705 const StringPiece& associated_data = GetAssociatedDataFromEncryptedPacket( | 1705 StringPiece associated_data = GetAssociatedDataFromEncryptedPacket( |
| 1706 packet, header.public_header.connection_id_length, | 1706 packet, header.public_header.connection_id_length, |
| 1707 header.public_header.version_flag, header.public_header.multipath_flag, | 1707 header.public_header.version_flag, header.public_header.multipath_flag, |
| 1708 header.public_header.packet_number_length); | 1708 header.public_header.packet_number_length); |
| 1709 bool success = decrypter_->DecryptPacket( | 1709 bool success = decrypter_->DecryptPacket( |
| 1710 header.path_id, header.packet_number, associated_data, encrypted, | 1710 header.path_id, header.packet_number, associated_data, encrypted, |
| 1711 decrypted_buffer, decrypted_length, buffer_length); | 1711 decrypted_buffer, decrypted_length, buffer_length); |
| 1712 if (success) { | 1712 if (success) { |
| 1713 visitor_->OnDecryptedPacket(decrypter_level_); | 1713 visitor_->OnDecryptedPacket(decrypter_level_); |
| 1714 } else if (alternative_decrypter_.get() != nullptr) { | 1714 } else if (alternative_decrypter_.get() != nullptr) { |
| 1715 success = alternative_decrypter_->DecryptPacket( | 1715 success = alternative_decrypter_->DecryptPacket( |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2226 | 2226 |
| 2227 bool QuicFramer::RaiseError(QuicErrorCode error) { | 2227 bool QuicFramer::RaiseError(QuicErrorCode error) { |
| 2228 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) | 2228 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) |
| 2229 << " detail: " << detailed_error_; | 2229 << " detail: " << detailed_error_; |
| 2230 set_error(error); | 2230 set_error(error); |
| 2231 visitor_->OnError(this); | 2231 visitor_->OnError(this); |
| 2232 return false; | 2232 return false; |
| 2233 } | 2233 } |
| 2234 | 2234 |
| 2235 } // namespace net | 2235 } // namespace net |
| OLD | NEW |