aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/exp/ssh
diff options
context:
space:
mode:
authorLuit van Drongelen <luitvd@gmail.com>2012-01-19 17:28:38 -0500
committerAdam Langley <agl@golang.org>2012-01-19 17:28:38 -0500
commit8d66a416cb4b84abeaeccaa69dda3783dda1b76a (patch)
treefe3325ec35eb2d6a7574240599f3d0ae8fbe9a01 /src/pkg/exp/ssh
parentee09a8cd9fee2f38fd100bd27451c4284f7e9d96 (diff)
downloadgo-8d66a416cb4b84abeaeccaa69dda3783dda1b76a.tar.xz
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
Diffstat (limited to 'src/pkg/exp/ssh')
-rw-r--r--src/pkg/exp/ssh/transport.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/exp/ssh/transport.go b/src/pkg/exp/ssh/transport.go
index 60a636f0a4..e21bc4ba20 100644
--- a/src/pkg/exp/ssh/transport.go
+++ b/src/pkg/exp/ssh/transport.go
@@ -9,6 +9,7 @@ import (
"crypto"
"crypto/cipher"
"crypto/hmac"
+ "crypto/sha1"
"crypto/subtle"
"errors"
"hash"
@@ -266,7 +267,7 @@ func (c *common) setupKeys(d direction, K, H, sessionId []byte, hashFunc crypto.
generateKeyMaterial(key, d.keyTag, K, H, sessionId, h)
generateKeyMaterial(macKey, d.macKeyTag, K, H, sessionId, h)
- c.mac = truncatingMAC{12, hmac.NewSHA1(macKey)}
+ c.mac = truncatingMAC{12, hmac.New(sha1.New, macKey)}
cipher, err := cipherMode.createCipher(key, iv)
if err != nil {