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

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

Issue 388333005: Reject reasons from strike register when nonce validation fails. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updating with TOT 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 | « net/quic/crypto/crypto_server_test.cc ('k') | net/quic/crypto/local_strike_register_client_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/local_strike_register_client.cc
diff --git a/net/quic/crypto/local_strike_register_client.cc b/net/quic/crypto/local_strike_register_client.cc
index 1f78d9833d597b2414d714da5d0e74e25a119cf6..71d222448f1ec2133d20604e9ce3d6f3a34f0e2e 100644
--- a/net/quic/crypto/local_strike_register_client.cc
+++ b/net/quic/crypto/local_strike_register_client.cc
@@ -30,19 +30,21 @@ bool LocalStrikeRegisterClient::IsKnownOrbit(StringPiece orbit) const {
}
void LocalStrikeRegisterClient::VerifyNonceIsValidAndUnique(
- StringPiece nonce, QuicWallTime now, ResultCallback* cb) {
- bool nonce_is_valid_and_unique;
+ StringPiece nonce,
+ QuicWallTime now,
+ ResultCallback* cb) {
+ InsertStatus nonce_error;
if (nonce.length() != kNonceSize) {
- nonce_is_valid_and_unique = false;
+ nonce_error = NONCE_INVALID_FAILURE;
} else {
base::AutoLock lock(m_);
- nonce_is_valid_and_unique = strike_register_.Insert(
+ nonce_error = strike_register_.Insert(
reinterpret_cast<const uint8*>(nonce.data()),
static_cast<uint32>(now.ToUNIXSeconds()));
}
// m_ must not be held when the ResultCallback runs.
- cb->Run(nonce_is_valid_and_unique);
+ cb->Run((nonce_error == NONCE_OK), nonce_error);
}
} // namespace net
« no previous file with comments | « net/quic/crypto/crypto_server_test.cc ('k') | net/quic/crypto/local_strike_register_client_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698