From 83ae8077f5dfcf855edf953af11914e58a631fb5 Mon Sep 17 00:00:00 2001 From: Nate Brown Date: Thu, 20 Nov 2025 14:22:58 -0500 Subject: [PATCH] No need to clear counter 0 (#1537) --- connection_state.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/connection_state.go b/connection_state.go index faee443..db885d4 100644 --- a/connection_state.go +++ b/connection_state.go @@ -50,11 +50,6 @@ func NewConnectionState(l *logrus.Logger, cs *CertState, crt cert.Certificate, i } static := noise.DHKey{Private: cs.privateKey, Public: crt.PublicKey()} - - b := NewBits(ReplayWindow) - // Clear out bit 0, we never transmit it, and we don't want it showing as packet loss - b.Update(l, 0) - hs, err := noise.NewHandshakeState(noise.Config{ CipherSuite: ncs, Random: rand.Reader, @@ -74,7 +69,7 @@ func NewConnectionState(l *logrus.Logger, cs *CertState, crt cert.Certificate, i ci := &ConnectionState{ H: hs, initiator: initiator, - window: b, + window: NewBits(ReplayWindow), myCert: crt, } // always start the counter from 2, as packet 1 and packet 2 are handshake packets.