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

Unified Diff: net/quic/quic_crypto_server_stream.cc

Issue 14083012: QUIC: retransmit packets with the correct encryption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved HandshakeMode enum to MockCryptoClientStream Created 7 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
Index: net/quic/quic_crypto_server_stream.cc
diff --git a/net/quic/quic_crypto_server_stream.cc b/net/quic/quic_crypto_server_stream.cc
index 5fa33e198d8aa015636987d1d5304832738a1046..1dab72f6be44e99028edc0a814d52fe6869db204 100644
--- a/net/quic/quic_crypto_server_stream.cc
+++ b/net/quic/quic_crypto_server_stream.cc
@@ -27,8 +27,8 @@ QuicCryptoServerStream::~QuicCryptoServerStream() {
void QuicCryptoServerStream::OnHandshakeMessage(
const CryptoHandshakeMessage& message) {
- // Do not process handshake messages after the handshake is complete.
- if (handshake_complete()) {
+ // Do not process handshake messages after the handshake is confirmed.
+ if (handshake_confirmed_) {
CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE);
return;
}
@@ -62,13 +62,18 @@ void QuicCryptoServerStream::OnHandshakeMessage(
// write key.
//
// NOTE: the SHLO will be encrypted with the new server write key.
- session()->connection()->ChangeEncrypter(
+ session()->connection()->SetEncrypter(
+ ENCRYPTION_INITIAL,
crypto_negotiated_params_.encrypter.release());
- // Be prepared to decrypt with the new client write key, as the client
- // will start to use it upon receiving the SHLO.
- session()->connection()->PushDecrypter(
+ session()->connection()->SetDefaultEncryptionLevel(
+ ENCRYPTION_INITIAL);
+ // Set the decrypter immediately so that we no longer accept unencrypted
+ // packets.
+ session()->connection()->SetDecrypter(
crypto_negotiated_params_.decrypter.release());
- SetHandshakeComplete(QUIC_NO_ERROR);
+ encryption_established_ = true;
+ handshake_confirmed_ = true;
+ session()->OnCryptoHandshakeEvent(QuicSession::HANDSHAKE_CONFIRMED);
}
SendHandshakeMessage(reply);

Powered by Google App Engine
This is Rietveld 408576698