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

Unified Diff: net/quic/crypto/crypto_server_config.cc

Issue 23464033: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix valgrind error Created 7 years, 3 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/crypto/crypto_server_config.h ('k') | net/quic/crypto/source_address_token.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/crypto_server_config.cc
diff --git a/net/quic/crypto/crypto_server_config.cc b/net/quic/crypto/crypto_server_config.cc
index f270ddeb31a0f84f2b0c5f86395657f6838d72d9..c5caa8c838dc0c976c1392a5390f31099f7b197f 100644
--- a/net/quic/crypto/crypto_server_config.cc
+++ b/net/quic/crypto/crypto_server_config.cc
@@ -11,6 +11,7 @@
#include "base/strings/string_number_conversions.h"
#include "crypto/hkdf.h"
#include "crypto/secure_hash.h"
+#include "net/base/net_util.h"
#include "net/quic/crypto/aes_128_gcm_12_decrypter.h"
#include "net/quic/crypto/aes_128_gcm_12_encrypter.h"
#include "net/quic/crypto/cert_compressor.h"
@@ -56,6 +57,7 @@ QuicCryptoServerConfig::QuicCryptoServerConfig(
next_config_promotion_time_(QuicWallTime::Zero()),
strike_register_lock_(),
server_nonce_strike_register_lock_(),
+ strike_register_no_startup_period_(false),
strike_register_max_entries_(1 << 10),
strike_register_window_secs_(600),
source_address_token_future_secs_(3600),
@@ -636,6 +638,8 @@ QuicErrorCode QuicCryptoServerConfig::EvaluateClientHello(
static_cast<uint32>(info->now.ToUNIXSeconds()),
strike_register_window_secs_,
orbit,
+ strike_register_no_startup_period_ ?
+ StrikeRegister::NO_STARTUP_PERIOD_NEEDED :
StrikeRegister::DENY_REQUESTS_AT_STARTUP));
}
@@ -908,6 +912,12 @@ void QuicCryptoServerConfig::set_replay_protection(bool on) {
replay_protection_ = on;
}
+void QuicCryptoServerConfig::set_strike_register_no_startup_period() {
+ base::AutoLock auto_lock(strike_register_lock_);
+ DCHECK(!strike_register_.get());
+ strike_register_no_startup_period_ = true;
+}
+
void QuicCryptoServerConfig::set_strike_register_max_entries(
uint32 max_entries) {
base::AutoLock locker(strike_register_lock_);
@@ -949,7 +959,7 @@ string QuicCryptoServerConfig::NewSourceAddressToken(
QuicRandom* rand,
QuicWallTime now) const {
SourceAddressToken source_address_token;
- source_address_token.set_ip(ip.ToString());
+ source_address_token.set_ip(IPAddressToPackedString(ip.address()));
source_address_token.set_timestamp(now.ToUNIXSeconds());
return source_address_token_boxer_.Box(
@@ -972,7 +982,7 @@ bool QuicCryptoServerConfig::ValidateSourceAddressToken(
return false;
}
- if (source_address_token.ip() != ip.ToString()) {
+ if (source_address_token.ip() != IPAddressToPackedString(ip.address())) {
// It's for a different IP address.
return false;
}
« no previous file with comments | « net/quic/crypto/crypto_server_config.h ('k') | net/quic/crypto/source_address_token.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698