Permalink
Browse files

gofix for hmac api change

  • Loading branch information...
1 parent 2069914 commit ef28382a3e2a1f6f6c3dbf5b860bcfd7f577ec5d @bpowers committed Jan 26, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 seshcookie.go
View
@@ -11,6 +11,7 @@ import (
"crypto/hmac"
"crypto/rand"
"crypto/sha1"
+ "crypto/sha256"
"crypto/subtle"
"encoding/base64"
"encoding/gob"
@@ -194,7 +195,7 @@ func encodeCookie(content interface{}, encKey, hmacKey []byte) (string, []byte,
return "", nil, err
}
- hmacHash := hmac.NewSHA256(hmacKey)
+ hmacHash := hmac.New(sha256.New, hmacKey)
sessionBytes, err := encode(aesCipher, hmacHash, encodedGob)
if err != nil {
@@ -243,7 +244,7 @@ func decodeCookie(encoded string, encKey, hmacKey []byte) (map[string]interface{
return nil, nil, err
}
- hmacHash := hmac.NewSHA256(hmacKey)
+ hmacHash := hmac.New(sha256.New, hmacKey)
gobBytes, err := decode(aesCipher, hmacHash, sessionBytes)
if err != nil {
return nil, nil, err

0 comments on commit ef28382

Please sign in to comment.