diff options
author | Kamil Kisiel <kamil@kamilkisiel.net> | 2014-04-09 15:11:00 +0400 |
---|---|---|
committer | Kamil Kisiel <kamil@kamilkisiel.net> | 2014-04-09 15:11:00 +0400 |
commit | 1b0c7f6e9ab3d7f500fd7d50c7ad835ff428139b (patch) | |
tree | b8921092c3d8fbf4a61af8bf43d98f372e16651b /securecookie.go | |
parent | 972f32923fd3555b7f0ea39acdc4e3d4d5412ee8 (diff) | |
parent | 80d12bdee40faeca122aeb859a8995ade32cad13 (diff) |
Merge pull request #7 from hjr265/master
Expose ErrMacInvalid
Diffstat (limited to 'securecookie.go')
-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 ----------------------------------------------------------------- |