diff options
author | Kamil Kisiel <kamil@kamilkisiel.net> | 2015-02-03 09:33:18 +0300 |
---|---|---|
committer | Kamil Kisiel <kamil@kamilkisiel.net> | 2015-02-03 09:33:18 +0300 |
commit | 5f171f42328bdd573211bb82bdee8f259c4c61ae (patch) | |
tree | 5e3eb2087b20f6bebd7315d36097624527aac873 | |
parent | f0559d009e6943011cd1ba6eb16195cf5e0ed326 (diff) |
Fix broken error message on invalid MAC.
Fixes #13.
-rw-r--r-- | securecookie.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/securecookie.go b/securecookie.go index 6b70268..620c508 100644 --- a/securecookie.go +++ b/securecookie.go @@ -196,7 +196,7 @@ func (s *SecureCookie) Decode(name, value string, dst interface{}) error { // 3. Verify MAC. Value is "date|value|mac". parts := bytes.SplitN(b, []byte("|"), 3) if len(parts) != 3 { - return errors.New("securecookie: invalid value %v") + return ErrMacInvalid } h := hmac.New(s.hashFunc, s.hashKey) b = append([]byte(name+"|"), b[:len(b)-len(parts[2])-1]...) |