Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiSubira committed Jul 13, 2023
1 parent 9030f86 commit b210278
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/slayers/pkt_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ func (o PacketAuthOption) Algorithm() PacketAuthAlg {

// Timestamp returns the value set in the homonym field in the extension.
func (o PacketAuthOption) TimestampSN() uint64 {
return uint64(o.OptData[6])<<40 + uint64(o.OptData[7])<<32 + uint64(binary.BigEndian.Uint32(o.OptData[8:12]))
return uint64(o.OptData[6])<<40 + uint64(o.OptData[7])<<32 +
uint64(binary.BigEndian.Uint32(o.OptData[8:12]))
}

// Authenticator returns slice of the underlying auth buffer.
Expand Down
2 changes: 1 addition & 1 deletion pkg/spao/timestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

// RelativeTimestamp returns the relative timestamp (RelTime) as the time diference from
// time instant t to the begining of the drkey epoch.
// time instant t to the beginning of the drkey epoch.
func RelativeTimestamp(key drkey.ASHostKey, t time.Time) (uint64, error) {
relTime := t.Sub(key.Epoch.NotBefore).Nanoseconds()
if relTime >= (1 << 48) {
Expand Down
7 changes: 6 additions & 1 deletion router/dataplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -1806,7 +1806,12 @@ func (p *scionPacketProcessor) hasValidAuth(t time.Time) bool {
if err != nil {
return false
}
key, err := p.drkeyProvider.GetKeyWithinAcceptanceWindow(t, authOption.TimestampSN(), p.scionLayer.SrcIA, srcAddr)
key, err := p.drkeyProvider.GetKeyWithinAcceptanceWindow(
t,
authOption.TimestampSN(),
p.scionLayer.SrcIA,
srcAddr,
)
if err != nil {
log.Error("Selecting key to authenticate the incoming packet", "err", err)
return false
Expand Down

0 comments on commit b210278

Please sign in to comment.