| 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_connection.h" | 5 #include "net/quic/quic_connection.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 public: | 134 public: |
| 135 ~TaggingDecrypter() override {} | 135 ~TaggingDecrypter() override {} |
| 136 | 136 |
| 137 // QuicDecrypter interface | 137 // QuicDecrypter interface |
| 138 bool SetKey(StringPiece key) override { return true; } | 138 bool SetKey(StringPiece key) override { return true; } |
| 139 | 139 |
| 140 bool SetNoncePrefix(StringPiece nonce_prefix) override { return true; } | 140 bool SetNoncePrefix(StringPiece nonce_prefix) override { return true; } |
| 141 | 141 |
| 142 bool DecryptPacket(QuicPathId path_id, | 142 bool DecryptPacket(QuicPathId path_id, |
| 143 QuicPacketNumber packet_number, | 143 QuicPacketNumber packet_number, |
| 144 const StringPiece& associated_data, | 144 StringPiece associated_data, |
| 145 const StringPiece& ciphertext, | 145 StringPiece ciphertext, |
| 146 char* output, | 146 char* output, |
| 147 size_t* output_length, | 147 size_t* output_length, |
| 148 size_t max_output_length) override { | 148 size_t max_output_length) override { |
| 149 if (ciphertext.size() < kTagSize) { | 149 if (ciphertext.size() < kTagSize) { |
| 150 return false; | 150 return false; |
| 151 } | 151 } |
| 152 if (!CheckTag(ciphertext, GetTag(ciphertext))) { | 152 if (!CheckTag(ciphertext, GetTag(ciphertext))) { |
| 153 return false; | 153 return false; |
| 154 } | 154 } |
| 155 *output_length = ciphertext.size() - kTagSize; | 155 *output_length = ciphertext.size() - kTagSize; |
| (...skipping 4485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4641 // result in multiple attempts to close the connection - it will be marked as | 4641 // result in multiple attempts to close the connection - it will be marked as |
| 4642 // disconnected after the first call. | 4642 // disconnected after the first call. |
| 4643 EXPECT_CALL(visitor_, OnConnectionClosed(_, _)).Times(1); | 4643 EXPECT_CALL(visitor_, OnConnectionClosed(_, _)).Times(1); |
| 4644 connection_.SendConnectionCloseWithDetails(QUIC_NO_ERROR, "no reason"); | 4644 connection_.SendConnectionCloseWithDetails(QUIC_NO_ERROR, "no reason"); |
| 4645 connection_.SendConnectionCloseWithDetails(QUIC_NO_ERROR, "no reason"); | 4645 connection_.SendConnectionCloseWithDetails(QUIC_NO_ERROR, "no reason"); |
| 4646 } | 4646 } |
| 4647 | 4647 |
| 4648 } // namespace | 4648 } // namespace |
| 4649 } // namespace test | 4649 } // namespace test |
| 4650 } // namespace net | 4650 } // namespace net |
| OLD | NEW |