diff options
author | Mahmud Ridwan <m@hjr265.me> | 2014-04-09 07:48:55 +0400 |
---|---|---|
committer | Mahmud Ridwan <m@hjr265.me> | 2014-04-09 07:50:10 +0400 |
commit | 2cceedbccee22f41876de91a36d63ba898fde049 (patch) | |
tree | b8921092c3d8fbf4a61af8bf43d98f372e16651b | |
parent | 972f32923fd3555b7f0ea39acdc4e3d4d5412ee8 (diff) |
Expose ErrMacInvalid; fixes gorilla/securecookie#6
-rw-r--r-- | securecookie.go | 4 |
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 ----------------------------------------------------------------- |