Index: net/quic/test_tools/quic_test_utils.cc |
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc |
index c9b81de0c8029230dc92c5d07fe5991766e72b6a..594bb9b7a16649c3c617f241f7c7b27dcace9c24 100644 |
--- a/net/quic/test_tools/quic_test_utils.cc |
+++ b/net/quic/test_tools/quic_test_utils.cc |
@@ -82,6 +82,7 @@ QuicPacket* BuildUnsizedDataPacket(QuicFramer* framer, |
header.public_header.connection_id_length, |
header.public_header.version_flag, |
header.public_header.multipath_flag, |
+ header.public_header.nonce != nullptr, |
header.public_header.packet_number_length); |
} |
@@ -608,7 +609,7 @@ QuicEncryptedPacket* ConstructMisFramedEncryptedPacket( |
reinterpret_cast<unsigned char*>( |
packet->mutable_data())[GetStartOfEncryptedData( |
connection_id_length, version_flag, multipath_flag, |
- packet_number_length)] = 0xFF; |
+ false /* no diversification nonce */, packet_number_length)] = 0xFF; |
char* buffer = new char[kMaxPacketSize]; |
size_t encrypted_length = framer.EncryptPayload( |
@@ -699,6 +700,7 @@ QuicPacket* ConstructHandshakePacket(QuicConnectionId connection_id, |
size_t GetPacketLengthForOneStream(QuicVersion version, |
bool include_version, |
bool include_path_id, |
+ bool include_diversification_nonce, |
QuicConnectionIdLength connection_id_length, |
QuicPacketNumberLength packet_number_length, |
size_t* payload_length) { |
@@ -707,12 +709,13 @@ size_t GetPacketLengthForOneStream(QuicVersion version, |
NullEncrypter().GetCiphertextSize(*payload_length) + |
QuicPacketCreator::StreamFramePacketOverhead( |
PACKET_8BYTE_CONNECTION_ID, include_version, include_path_id, |
- packet_number_length, 0u); |
+ include_diversification_nonce, packet_number_length, 0u); |
const size_t ack_length = |
NullEncrypter().GetCiphertextSize( |
QuicFramer::GetMinAckFrameSize(PACKET_1BYTE_PACKET_NUMBER)) + |
GetPacketHeaderSize(connection_id_length, include_version, |
- include_path_id, packet_number_length); |
+ include_path_id, include_diversification_nonce, |
+ packet_number_length); |
if (stream_length < ack_length) { |
*payload_length = 1 + ack_length - stream_length; |
} |
@@ -720,7 +723,7 @@ size_t GetPacketLengthForOneStream(QuicVersion version, |
return NullEncrypter().GetCiphertextSize(*payload_length) + |
QuicPacketCreator::StreamFramePacketOverhead( |
connection_id_length, include_version, include_path_id, |
- packet_number_length, 0u); |
+ include_diversification_nonce, packet_number_length, 0u); |
} |
TestEntropyCalculator::TestEntropyCalculator() {} |