From b6c86e04e886310cd8fee05965f9d162ea4c2de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Subir=C3=A0=20Nieto?= Date: Mon, 14 Aug 2023 16:19:51 +0200 Subject: [PATCH] pass --- private/drkey/drkeyutil/drkey.go | 6 +++--- private/drkey/drkeyutil/provider.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/private/drkey/drkeyutil/drkey.go b/private/drkey/drkeyutil/drkey.go index d2a6f6588d..7f34d5e0d7 100644 --- a/private/drkey/drkeyutil/drkey.go +++ b/private/drkey/drkeyutil/drkey.go @@ -19,7 +19,7 @@ const ( // // Picking the value equal or shorter than half of the drkey Grace Period ensures // that we accept packets for active keys only. - DefaultAcceptanceWindowOffset = 2*time.Second + 500*time.Millisecond + DefaultAcceptanceWindowLength = 5 EnvVarAccpetanceWindow = "SCION_TESTING_ACCEPTANCE_WINDOW" ) @@ -38,11 +38,11 @@ func LoadEpochDuration() time.Duration { func LoadAcceptanceWindow() time.Duration { s := os.Getenv(EnvVarAccpetanceWindow) if s == "" { - return DefaultAcceptanceWindowOffset + return DefaultAcceptanceWindowLength } duration, err := util.ParseDuration(s) if err != nil { - return DefaultAcceptanceWindowOffset + return DefaultAcceptanceWindowLength } return duration } diff --git a/private/drkey/drkeyutil/provider.go b/private/drkey/drkeyutil/provider.go index a1b9cf335c..4c962d1a32 100644 --- a/private/drkey/drkeyutil/provider.go +++ b/private/drkey/drkeyutil/provider.go @@ -56,8 +56,8 @@ func (p *FakeProvider) GetKeyWithinAcceptanceWindow( return drkey.ASHostKey{}, err } - awBegin := t.Add(-(p.AcceptanceWindow)) - awEnd := t.Add(p.AcceptanceWindow) + awBegin := t.Add(-(p.AcceptanceWindow / 2)) + awEnd := t.Add(p.AcceptanceWindow / 2) validity := cppki.Validity{ NotBefore: awBegin, NotAfter: awEnd,