mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-22 08:24:25 +01:00
initialize messageCounter to 2 instead of verifying later (#1156)
Clean up the messageCounter checks added in #1154. Instead of checking that messageCounter is still at 2, just initialize it to 2 and only increment for non-handshake messages. Handshake packets will always be packets 1 and 2.
This commit is contained in:
@@ -72,6 +72,8 @@ func NewConnectionState(l *logrus.Logger, cipher string, certState *CertState, i
|
||||
window: b,
|
||||
myCert: certState.Certificate,
|
||||
}
|
||||
// always start the counter from 2, as packet 1 and packet 2 are handshake packets.
|
||||
ci.messageCounter.Add(2)
|
||||
|
||||
return ci
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user