Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: net/quic/test_tools/quic_test_utils.cc

Issue 1904213002: QUIC: support diversified keys with version 33. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hkdf
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/quic/test_tools/simple_quic_framer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {}
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/quic/test_tools/simple_quic_framer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698