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,