mirror of
https://github.com/slackhq/nebula.git
synced 2025-12-05 18:20:48 -08:00
No need to clear counter 0 (#1537)
This commit is contained in:
parent
12cf348c80
commit
83ae8077f5
1 changed files with 1 additions and 6 deletions
|
|
@ -50,11 +50,6 @@ func NewConnectionState(l *logrus.Logger, cs *CertState, crt cert.Certificate, i
|
||||||
}
|
}
|
||||||
|
|
||||||
static := noise.DHKey{Private: cs.privateKey, Public: crt.PublicKey()}
|
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{
|
hs, err := noise.NewHandshakeState(noise.Config{
|
||||||
CipherSuite: ncs,
|
CipherSuite: ncs,
|
||||||
Random: rand.Reader,
|
Random: rand.Reader,
|
||||||
|
|
@ -74,7 +69,7 @@ func NewConnectionState(l *logrus.Logger, cs *CertState, crt cert.Certificate, i
|
||||||
ci := &ConnectionState{
|
ci := &ConnectionState{
|
||||||
H: hs,
|
H: hs,
|
||||||
initiator: initiator,
|
initiator: initiator,
|
||||||
window: b,
|
window: NewBits(ReplayWindow),
|
||||||
myCert: crt,
|
myCert: crt,
|
||||||
}
|
}
|
||||||
// always start the counter from 2, as packet 1 and packet 2 are handshake packets.
|
// always start the counter from 2, as packet 1 and packet 2 are handshake packets.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue