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

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

Issue 23019005: Clear the QUIC cached proof when a client receives a REJ w/o a PROF tag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments Created 7 years, 4 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_handshake.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/crypto_handshake.cc
diff --git a/net/quic/crypto/crypto_handshake.cc b/net/quic/crypto/crypto_handshake.cc
index d6a76f9f51195005e52a385a06cfbb636265f153..2110d183a3676dada32186addb11b41fb7888e0f 100644
--- a/net/quic/crypto/crypto_handshake.cc
+++ b/net/quic/crypto/crypto_handshake.cc
@@ -470,6 +470,12 @@ void QuicCryptoClientConfig::CachedState::SetProof(const vector<string>& certs,
server_config_sig_ = signature.as_string();
}
+void QuicCryptoClientConfig::CachedState::ClearProof() {
+ SetProofInvalid();
+ certs_.clear();
+ server_config_sig_.clear();
+}
+
void QuicCryptoClientConfig::CachedState::SetProofValid() {
server_config_valid_ = true;
}
@@ -822,8 +828,9 @@ QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
}
StringPiece proof, cert_bytes;
- if (rej.GetStringPiece(kPROF, &proof) &&
- rej.GetStringPiece(kCertificateTag, &cert_bytes)) {
+ bool has_proof = rej.GetStringPiece(kPROF, &proof);
+ bool has_cert = rej.GetStringPiece(kCertificateTag, &cert_bytes);
+ if (has_proof && has_cert) {
vector<string> certs;
if (!CertCompressor::DecompressChain(cert_bytes, out_params->cached_certs,
common_cert_sets, &certs)) {
@@ -832,6 +839,17 @@ QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
}
cached->SetProof(certs, proof);
+ } else {
+ cached->ClearProof();
+ if (has_proof && !has_cert) {
+ *error_details = "Certificate missing";
+ return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
+ }
+
+ if (!has_proof && has_cert) {
+ *error_details = "Proof missing";
+ return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
+ }
}
return QUIC_NO_ERROR;
« no previous file with comments | « net/quic/crypto/crypto_handshake.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698