aboutsummaryrefslogtreecommitdiff
path: root/securecookie.go
diff options
context:
space:
mode:
authorMahmud Ridwan <m@hjr265.me>2014-04-09 07:48:55 +0400
committerMahmud Ridwan <m@hjr265.me>2014-04-09 07:50:10 +0400
commit2cceedbccee22f41876de91a36d63ba898fde049 (patch)
treeb8921092c3d8fbf4a61af8bf43d98f372e16651b /securecookie.go
parent972f32923fd3555b7f0ea39acdc4e3d4d5412ee8 (diff)
Expose ErrMacInvalid; fixes gorilla/securecookie#6
Diffstat (limited to 'securecookie.go')
-rw-r--r--securecookie.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/securecookie.go b/securecookie.go
index 9147f6a..74b8acc 100644
--- a/securecookie.go
+++ b/securecookie.go
@@ -25,6 +25,8 @@ import (
var (
errNoCodecs = errors.New("securecookie: no codecs provided")
errHashKeyNotSet = errors.New("securecookie: hash key is not set")
+
+ ErrMacInvalid = errors.New("securecookie: the value is not valid")
)
// Codec defines an interface to encode and decode cookie values.
@@ -256,7 +258,7 @@ func verifyMac(h hash.Hash, value []byte, mac []byte) error {
if len(mac) == len(mac2) && subtle.ConstantTimeCompare(mac, mac2) == 1 {
return nil
}
- return errors.New("securecookie: the value is not valid")
+ return ErrMacInvalid
}
// Encryption -----------------------------------------------------------------