| 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/test_tools/crypto_test_utils.h" | 5 #include "net/quic/test_tools/crypto_test_utils.h" |
| 6 | 6 |
| 7 #include <openssl/bn.h> | 7 #include <openssl/bn.h> |
| 8 #include <openssl/ec.h> | 8 #include <openssl/ec.h> |
| 9 #include <openssl/ecdsa.h> | 9 #include <openssl/ecdsa.h> |
| 10 #include <openssl/evp.h> | 10 #include <openssl/evp.h> |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 size_t index = *inout_packet_index; | 785 size_t index = *inout_packet_index; |
| 786 for (; index < source_conn->encrypted_packets_.size(); index++) { | 786 for (; index < source_conn->encrypted_packets_.size(); index++) { |
| 787 if (!framer.ProcessPacket(*source_conn->encrypted_packets_[index])) { | 787 if (!framer.ProcessPacket(*source_conn->encrypted_packets_[index])) { |
| 788 // The framer will be unable to decrypt forward-secure packets sent after | 788 // The framer will be unable to decrypt forward-secure packets sent after |
| 789 // the handshake is complete. Don't treat them as handshake packets. | 789 // the handshake is complete. Don't treat them as handshake packets. |
| 790 break; | 790 break; |
| 791 } | 791 } |
| 792 | 792 |
| 793 for (const QuicStreamFrame* stream_frame : framer.stream_frames()) { | 793 for (const QuicStreamFrame* stream_frame : framer.stream_frames()) { |
| 794 ASSERT_TRUE(crypto_framer.ProcessInput( | 794 ASSERT_TRUE(crypto_framer.ProcessInput( |
| 795 StringPiece(stream_frame->frame_buffer, stream_frame->frame_length))); | 795 StringPiece(stream_frame->data_buffer, stream_frame->data_length))); |
| 796 ASSERT_FALSE(crypto_visitor.error()); | 796 ASSERT_FALSE(crypto_visitor.error()); |
| 797 } | 797 } |
| 798 } | 798 } |
| 799 *inout_packet_index = index; | 799 *inout_packet_index = index; |
| 800 | 800 |
| 801 QuicConnectionPeer::SwapCrypters(dest_conn, framer.framer()); | 801 QuicConnectionPeer::SwapCrypters(dest_conn, framer.framer()); |
| 802 | 802 |
| 803 ASSERT_EQ(0u, crypto_framer.InputBytesRemaining()); | 803 ASSERT_EQ(0u, crypto_framer.InputBytesRemaining()); |
| 804 | 804 |
| 805 for (const CryptoHandshakeMessage& message : crypto_visitor.messages()) { | 805 for (const CryptoHandshakeMessage& message : crypto_visitor.messages()) { |
| 806 dest_stream->OnHandshakeMessage(message); | 806 dest_stream->OnHandshakeMessage(message); |
| 807 } | 807 } |
| 808 } | 808 } |
| 809 | 809 |
| 810 } // namespace test | 810 } // namespace test |
| 811 } // namespace net | 811 } // namespace net |
| OLD | NEW |