diff --git a/token/hmac/hmacsha.go b/token/hmac/hmacsha.go index 6ac51d35b..475137c15 100644 --- a/token/hmac/hmacsha.go +++ b/token/hmac/hmacsha.go @@ -19,7 +19,7 @@ * */ -// Package hmac is the default implementation for generating and validating challenges. It uses HMAC-SHA256 to +// Package hmac is the default implementation for generating and validating challenges. It uses SHA-512/256 to // generate and validate challenges. package hmac @@ -64,7 +64,7 @@ func (c *HMACStrategy) Generate() (string, string, error) { defer c.Unlock() if len(c.GlobalSecret) < minimumSecretLength { - return "", "", errors.Errorf("secret for signing HMAC-SHA256 is expected to be 32 byte long, got %d byte", len(c.GlobalSecret)) + return "", "", errors.Errorf("secret for signing HMAC-SHA512_256 is expected to be 32 byte long, got %d byte", len(c.GlobalSecret)) } var signingKey [32]byte @@ -115,7 +115,7 @@ func (c *HMACStrategy) Validate(token string) (err error) { } if err == nil { - return errors.New("a secret for signing HMAC-SHA256 is expected to be defined, but none were") + return errors.New("a secret for signing HMAC-SHA512/256 is expected to be defined, but none were") } return err @@ -123,7 +123,7 @@ func (c *HMACStrategy) Validate(token string) (err error) { func (c *HMACStrategy) validate(secret []byte, token string) error { if len(secret) < minimumSecretLength { - return errors.Errorf("secret for signing HMAC-SHA256 is expected to be 32 byte long, got %d byte", len(secret)) + return errors.Errorf("secret for signing HMAC-SHA512/256 is expected to be 32 byte long, got %d byte", len(secret)) } var signingKey [32]byte