| 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 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 string plaintext_; | 147 string plaintext_; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 class TestDecrypter : public QuicDecrypter { | 150 class TestDecrypter : public QuicDecrypter { |
| 151 public: | 151 public: |
| 152 ~TestDecrypter() override {} | 152 ~TestDecrypter() override {} |
| 153 bool SetKey(StringPiece key) override { return true; } | 153 bool SetKey(StringPiece key) override { return true; } |
| 154 bool SetNoncePrefix(StringPiece nonce_prefix) override { return true; } | 154 bool SetNoncePrefix(StringPiece nonce_prefix) override { return true; } |
| 155 bool DecryptPacket(QuicPathId path_id, | 155 bool DecryptPacket(QuicPathId path_id, |
| 156 QuicPacketNumber packet_number, | 156 QuicPacketNumber packet_number, |
| 157 const StringPiece& associated_data, | 157 StringPiece associated_data, |
| 158 const StringPiece& ciphertext, | 158 StringPiece ciphertext, |
| 159 char* output, | 159 char* output, |
| 160 size_t* output_length, | 160 size_t* output_length, |
| 161 size_t max_output_length) override { | 161 size_t max_output_length) override { |
| 162 path_id_ = path_id; | 162 path_id_ = path_id; |
| 163 packet_number_ = packet_number; | 163 packet_number_ = packet_number; |
| 164 associated_data_ = associated_data.as_string(); | 164 associated_data_ = associated_data.as_string(); |
| 165 ciphertext_ = ciphertext.as_string(); | 165 ciphertext_ = ciphertext.as_string(); |
| 166 memcpy(output, ciphertext.data(), ciphertext.length()); | 166 memcpy(output, ciphertext.data(), ciphertext.length()); |
| 167 *output_length = ciphertext.length(); | 167 *output_length = ciphertext.length(); |
| 168 return true; | 168 return true; |
| (...skipping 4456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4625 'o', ' ', 'w', 'o', | 4625 'o', ' ', 'w', 'o', |
| 4626 'r', 'l', 'd', '!', | 4626 'r', 'l', 'd', '!', |
| 4627 }; | 4627 }; |
| 4628 // clang-format on | 4628 // clang-format on |
| 4629 | 4629 |
| 4630 QuicFramerFuzzFunc(packet, arraysize(packet)); | 4630 QuicFramerFuzzFunc(packet, arraysize(packet)); |
| 4631 } | 4631 } |
| 4632 | 4632 |
| 4633 } // namespace test | 4633 } // namespace test |
| 4634 } // namespace net | 4634 } // namespace net |
| OLD | NEW |