Skip to content

Commit

Permalink
pass
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiSubira committed Sep 22, 2023
1 parent 5adbcf5 commit b6c86e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions private/drkey/drkeyutil/drkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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
}
4 changes: 2 additions & 2 deletions private/drkey/drkeyutil/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b6c86e0

Please sign in to comment.