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

Unified Diff: net/quic/quic_packet_creator.h

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/quic_framer_test.cc ('k') | net/quic/quic_packet_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_creator.h
diff --git a/net/quic/quic_packet_creator.h b/net/quic/quic_packet_creator.h
index bf9035b5c547cb4101d52d18e2088c5788f6d38c..7c976db910a494ecf1b6dd7bf6062ea133116413 100644
--- a/net/quic/quic_packet_creator.h
+++ b/net/quic/quic_packet_creator.h
@@ -72,6 +72,11 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
// Makes the framer not serialize the protocol version in sent packets.
void StopSendingVersion();
+ // SetDiversificationNonce sets the nonce that will be sent in each public
+ // header of packets encrypted at the initial encryption level. Should only
+ // be called by servers.
+ void SetDiversificationNonce(const DiversificationNonce nonce);
+
// Update the packet number length to use in future packets as soon as it
// can be safely changed.
// TODO(fayang): Directly set packet number length instead of compute it in
@@ -84,6 +89,7 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
QuicConnectionIdLength connection_id_length,
bool include_version,
bool include_path_id,
+ bool include_diversification_nonce,
QuicPacketNumberLength packet_number_length,
QuicStreamOffset offset);
@@ -261,6 +267,10 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
// Clears all fields of packet_ that should be cleared between serializations.
void ClearPacket();
+ // Returns true if a diversification nonce should be included in the current
+ // packet's public header.
+ bool IncludeNonceInPublicHeader();
+
// Does not own these delegates or the framer.
DelegateInterface* delegate_;
DebugDelegate* debug_delegate_;
@@ -278,6 +288,10 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
// a packet boundary, when the creator's packet_number_length_ can be changed
// to this new value.
QuicPacketNumberLength next_packet_number_length_;
+ // If true, then |nonce_for_public_header_| will be included in the public
+ // header of all packets created at the initial encryption level.
+ bool have_diversification_nonce_;
+ DiversificationNonce diversification_nonce_;
// Maximum length including headers and encryption (UDP payload length.)
QuicByteCount max_packet_length_;
size_t max_plaintext_size_;
« no previous file with comments | « net/quic/quic_framer_test.cc ('k') | net/quic/quic_packet_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698