From c81c0dd22a7779148c4890cfd4bbf490054f06f1 Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 31 Jan 2019 17:06:36 +0100 Subject: Update vendor, move to labstack/echo/v4 Fixes #698 --- vendor/github.com/nlopes/slack/security.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'vendor/github.com/nlopes/slack/security.go') diff --git a/vendor/github.com/nlopes/slack/security.go b/vendor/github.com/nlopes/slack/security.go index 6ab3c698..35727027 100644 --- a/vendor/github.com/nlopes/slack/security.go +++ b/vendor/github.com/nlopes/slack/security.go @@ -42,7 +42,9 @@ func unsafeSignatureVerifier(header http.Header, secret string) (_ SecretsVerifi } hash := hmac.New(sha256.New, []byte(secret)) - hash.Write([]byte(fmt.Sprintf("v0:%s:", stimestamp))) + if _, err = hash.Write([]byte(fmt.Sprintf("v0:%s:", stimestamp))); err != nil { + return SecretsVerifier{}, err + } return SecretsVerifier{ signature: bsignature, @@ -66,7 +68,7 @@ func NewSecretsVerifier(header http.Header, secret string) (sv SecretsVerifier, return SecretsVerifier{}, err } - diff := absDuration(time.Now().Sub(time.Unix(timestamp, 0))) + diff := absDuration(time.Since(time.Unix(timestamp, 0))) if diff > 5*time.Minute { return SecretsVerifier{}, fmt.Errorf("timestamp is too old") } -- cgit v1.2.3