Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
}
prev += n
CheckMore:
+ if prev < govpn.MinPktLength {
+ continue
+ }
i = bytes.Index(buf[:prev], nonceExpectation)
if i == -1 {
continue
}
prev += n
CheckMore:
+ if prev < govpn.MinPktLength {
+ continue
+ }
i = bytes.Index(buf[:prev], nonceExpectation)
if i == -1 {
continue
PktSizeSize = 2
// Heartbeat rate, relative to Timeout
TimeoutHeartbeat = 4
+ // Minimal valid packet length: 2+
+ MinPktLength = 2 + 16 + 8
)
func newNonceCipher(key *[32]byte) *xtea.Cipher {