aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Kisiel <kamil@kamilkisiel.net>2014-04-09 15:11:00 +0400
committerKamil Kisiel <kamil@kamilkisiel.net>2014-04-09 15:11:00 +0400
commit1b0c7f6e9ab3d7f500fd7d50c7ad835ff428139b (patch)
treeb8921092c3d8fbf4a61af8bf43d98f372e16651b
parent972f32923fd3555b7f0ea39acdc4e3d4d5412ee8 (diff)
parent80d12bdee40faeca122aeb859a8995ade32cad13 (diff)
Merge pull request #7 from hjr265/master
Expose ErrMacInvalid
-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 -----------------------------------------------------------------