Fix KEX test on windows

This makes the code rotate the key if `time.Since(kexCurrentTime) == kexLifetime`, which prevents an issue with low-resolution clocks (e.g. in our appveyor tests).
This commit is contained in:
Lucas Clemente
2018-04-30 11:14:46 +02:00
committed by GitHub
parent 47fd869154
commit 5907bfa168

View File

@@ -35,7 +35,7 @@ func getEphermalKEX() (crypto.KeyExchange, error) {
kexMutex.Lock()
defer kexMutex.Unlock()
// Check if still unfulfilled
if kexCurrent == nil || time.Since(kexCurrentTime) > kexLifetime {
if kexCurrent == nil || time.Since(kexCurrentTime) >= kexLifetime {
kex, err := crypto.NewCurve25519KEX()
if err != nil {
return nil, err