From 0464590bc2955363cc16ef432ac4ee5b7760d100 Mon Sep 17 00:00:00 2001 From: Luit van Drongelen Date: Thu, 19 Jan 2012 17:28:38 -0500 Subject: [PATCH] crypto/hmac: Deprecate hmac.NewMD5, hmac.NewSHA1 and hmac.NewSHA256 Remove NewMD5, NewSHA1 and NewSHA256 in favor of using New and explicitly importing the used hash-function. This way when using, for example, HMAC with RIPEMD there's no md5, sha1 and sha256 linked in through the hmac package. A gofix rule is included, and applied to the standard library (3 files altered). This change is the result of a discussion at https://golang.org/cl/5550043/ to pull the discussion about deprecating these functions out of that issue. R=golang-dev, agl CC=golang-dev, r, rsc https://golang.org/cl/5556058 --- cipher_suites.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cipher_suites.go b/cipher_suites.go index 914491d..00695e7 100644 --- a/cipher_suites.go +++ b/cipher_suites.go @@ -91,7 +91,7 @@ func macSHA1(version uint16, key []byte) macFunction { copy(mac.key, key) return mac } - return tls10MAC{hmac.NewSHA1(key)} + return tls10MAC{hmac.New(sha1.New, key)} } type macFunction interface {