crypto/hmac: make Sum idempotent

Fixes #978.

R=rsc
CC=golang-dev
https://golang.org/cl/1967045
This commit is contained in:
Jukka-Pekka Kekkonen 2010-08-26 13:32:29 -04:00 committed by Russ Cox
parent 33cb46903e
commit ba5b09f786
5 changed files with 33 additions and 33 deletions

View file

@ -8,7 +8,6 @@ import (
"crypto/hmac"
"crypto/rc4"
"crypto/rsa"
"crypto/sha1"
"crypto/subtle"
"crypto/x509"
"io"
@ -226,7 +225,7 @@ func (c *Conn) clientHandshake() os.Error {
cipher, _ := rc4.NewCipher(clientKey)
c.out.prepareCipherSpec(cipher, hmac.New(sha1.New(), clientMAC))
c.out.prepareCipherSpec(cipher, hmac.NewSHA1(clientMAC))
c.writeRecord(recordTypeChangeCipherSpec, []byte{1})
finished := new(finishedMsg)
@ -235,7 +234,7 @@ func (c *Conn) clientHandshake() os.Error {
c.writeRecord(recordTypeHandshake, finished.marshal())
cipher2, _ := rc4.NewCipher(serverKey)
c.in.prepareCipherSpec(cipher2, hmac.New(sha1.New(), serverMAC))
c.in.prepareCipherSpec(cipher2, hmac.NewSHA1(serverMAC))
c.readRecord(recordTypeChangeCipherSpec)
if c.err != nil {
return c.err