diff options
Diffstat (limited to 'src/crypto/tls/cipher_suites.go')
-rw-r--r-- | src/crypto/tls/cipher_suites.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/crypto/tls/cipher_suites.go b/src/crypto/tls/cipher_suites.go index beb0f1926d..2aeaf668e4 100644 --- a/src/crypto/tls/cipher_suites.go +++ b/src/crypto/tls/cipher_suites.go @@ -9,6 +9,7 @@ import ( "crypto/cipher" "crypto/des" "crypto/hmac" + "crypto/internal/boring" "crypto/rc4" "crypto/sha1" "crypto/sha256" @@ -298,6 +299,11 @@ func (c *cthWrapper) Write(p []byte) (int, error) { return c.h.Write(p) } func (c *cthWrapper) Sum(b []byte) []byte { return c.h.ConstantTimeSum(b) } func newConstantTimeHash(h func() hash.Hash) func() hash.Hash { + if boring.Enabled { + // The BoringCrypto SHA1 does not have a constant-time + // checksum function, so don't try to use it. + return h + } return func() hash.Hash { return &cthWrapper{h().(constantTimeHash)} } |