enforce a minimum value of the remote idle timeout

This prevents a DoS where a peer could send us a really small remote
idle timeout, and we would continuously send it PING frames.
This commit is contained in:
Marten Seemann
2017-10-03 11:06:31 -07:00
parent 0ffb64b5d7
commit 4eec7433d9
7 changed files with 32 additions and 5 deletions

View File

@@ -113,6 +113,9 @@ const CryptoParameterMaxLength = 4000
// EphermalKeyLifetime is the lifetime of the ephermal key during the handshake, see handshake.getEphermalKEX.
const EphermalKeyLifetime = time.Minute
// MinRemoteIdleTimeout is the minimum value that we accept for the remote idle timeout
const MinRemoteIdleTimeout = 5 * time.Second
// DefaultIdleTimeout is the default idle timeout
const DefaultIdleTimeout = 30 * time.Second