aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Kisiel <kamil@kamilkisiel.net>2015-02-03 09:33:18 +0300
committerKamil Kisiel <kamil@kamilkisiel.net>2015-02-03 09:33:18 +0300
commit5f171f42328bdd573211bb82bdee8f259c4c61ae (patch)
tree5e3eb2087b20f6bebd7315d36097624527aac873
parentf0559d009e6943011cd1ba6eb16195cf5e0ed326 (diff)
Fix broken error message on invalid MAC.
Fixes #13.
-rw-r--r--securecookie.go2
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]...)