aboutsummaryrefslogtreecommitdiff
path: root/securecookie.go
diff options
context:
space:
mode:
authorKamil Kisiel <kamil@kamilkisiel.net>2015-03-18 02:33:49 +0300
committerKamil Kisiel <kamil@kamilkisiel.net>2015-03-18 02:33:49 +0300
commit1dea542d129e9ab34ef39cb211bede518064bb25 (patch)
tree79703b89ef56e738708a82650aa2b594893f093b /securecookie.go
parentfec4f16574c75566532e989ebf2a814604a74832 (diff)
parentd8773d3e667317064f921c6fc6d840871797afc7 (diff)
Merge pull request #16 from elithrar/patch-1
Removed redundant calls to len()
Diffstat (limited to 'securecookie.go')
-rw-r--r--securecookie.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/securecookie.go b/securecookie.go
index 2509608..99be197 100644
--- a/securecookie.go
+++ b/securecookie.go
@@ -271,7 +271,7 @@ func createMac(h hash.Hash, value []byte) []byte {
// verifyMac verifies that a message authentication code (MAC) is valid.
func verifyMac(h hash.Hash, value []byte, mac []byte) error {
mac2 := createMac(h, value)
- if len(mac) == len(mac2) && subtle.ConstantTimeCompare(mac, mac2) == 1 {
+ if subtle.ConstantTimeCompare(mac, mac2) == 1 {
return nil
}
return ErrMacInvalid