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

Unified Diff: net/quic/crypto/strike_register.h

Issue 389393005: Narrow the strike register window in both directions when tracking many (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added include for limits Created 6 years, 5 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 | « no previous file | net/quic/crypto/strike_register.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/strike_register.h
diff --git a/net/quic/crypto/strike_register.h b/net/quic/crypto/strike_register.h
index ddfb0458eaa9bc97849b025c9f9d00b00f6f08c9..6a69827e381c1077366957e632799e83f6eb16e0 100644
--- a/net/quic/crypto/strike_register.h
+++ b/net/quic/crypto/strike_register.h
@@ -116,14 +116,14 @@ class NET_EXPORT_PRIVATE StrikeRegister {
// 20 bytes of random data
//
// Otherwise, it inserts |nonce| into the observed set and returns true.
- bool Insert(const uint8 nonce[32], const uint32 current_time);
+ bool Insert(const uint8 nonce[32], uint32 current_time);
// orbit returns a pointer to the 8-byte orbit value for this
// strike-register.
const uint8* orbit() const;
// Time window for which the strike register has complete information.
- uint32 EffectiveWindowSecs(const uint32 current_time_external) const;
+ uint32 GetCurrentValidWindowSecs(uint32 current_time_external) const;
// This is a debugging aid which checks the tree for sanity.
void Validate();
@@ -134,6 +134,12 @@ class NET_EXPORT_PRIVATE StrikeRegister {
// TimeFromBytes returns a big-endian uint32 from |d|.
static uint32 TimeFromBytes(const uint8 d[4]);
+ // Range of internal times for which the strike register has
+ // complete information. A nonce is within the valid range of the
+ // strike register if:
+ // valid_range.first <= nonce_time_internal <= valid_range.second
+ std::pair<uint32, uint32> GetValidRange(uint32 current_time_internal) const;
+
// ExternalTimeToInternal converts an external time value into an internal
// time value using |internal_epoch_|.
uint32 ExternalTimeToInternal(uint32 external_time) const;
@@ -174,6 +180,7 @@ class NET_EXPORT_PRIVATE StrikeRegister {
// time.
const uint32 internal_epoch_;
uint8 orbit_[8];
+ // The strike register will reject nonces with internal times < |horizon_| .
uint32 horizon_;
uint32 internal_node_free_head_;
« no previous file with comments | « no previous file | net/quic/crypto/strike_register.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698