In quic, avoid infinite loop in onhandshakepacketsent if discarding initial key causes connection close (and yet another handshake packet gets sent). client only, not protected. Uncovered in crbug/1081193. PiperOrigin-RevId: 311385556 Change-Id: If02040ad6d47b3003c053b5b76b2d2418b8108be
diff --git a/quic/core/tls_client_handshaker.cc b/quic/core/tls_client_handshaker.cc index 5c42691..0378ed0 100644 --- a/quic/core/tls_client_handshaker.cc +++ b/quic/core/tls_client_handshaker.cc
@@ -345,9 +345,9 @@ if (initial_keys_dropped_) { return; } + initial_keys_dropped_ = true; handshaker_delegate()->DiscardOldEncryptionKey(ENCRYPTION_INITIAL); handshaker_delegate()->DiscardOldDecryptionKey(ENCRYPTION_INITIAL); - initial_keys_dropped_ = true; } void TlsClientHandshaker::OnConnectionClosed(QuicErrorCode /*error*/,