summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Silverlock <matt@eatsleeprepeat.net>2015-03-18 02:06:26 +0300
committerMatt Silverlock <matt@eatsleeprepeat.net>2015-03-18 02:06:26 +0300
commitd8773d3e667317064f921c6fc6d840871797afc7 (patch)
treef61886535048f4df5053b0fb28cabdfaf0c2b89c
parent5f171f42328bdd573211bb82bdee8f259c4c61ae (diff)
Removed redundant calls to len()
subtle.ConstantTimeCompare already undertakes a length check internally.
-rw-r--r--securecookie.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/securecookie.go b/securecookie.go
index 620c508..9218dc4 100644
--- a/securecookie.go
+++ b/securecookie.go
@@ -255,7 +255,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