From: Katie Hockman Date: Wed, 18 Nov 2020 18:30:16 +0000 (-0500) Subject: [dev.boringcrypto] crypto/hmac: merge up to 2a206c7 and skip test X-Git-Tag: go1.19beta1~484^2~66 X-Git-Url: http://www.git.cypherpunks.ru/?a=commitdiff_plain;h=95ceba18d3b4ba64617196b2d994a45ee7b3e8cd;p=gostls13.git [dev.boringcrypto] crypto/hmac: merge up to 2a206c7 and skip test TestNonUniqueHash will not work on boringcrypto because the hash.Hash that sha256 provides is noncomparable. Change-Id: Ie3dc2d5d775953c381674e22272cb3433daa1b31 --- 95ceba18d3b4ba64617196b2d994a45ee7b3e8cd diff --cc src/crypto/hmac/hmac_test.go index 7be8b1bbcf,25e67d7fe5..55415abf02 --- a/src/crypto/hmac/hmac_test.go +++ b/src/crypto/hmac/hmac_test.go @@@ -5,7 -5,6 +5,8 @@@ package hmac import ( + "bytes" ++ "crypto/internal/boring" "crypto/md5" "crypto/sha1" "crypto/sha256" @@@ -582,6 -556,17 +583,20 @@@ func TestHMAC(t *testing.T) } } + func TestNonUniqueHash(t *testing.T) { ++ if boring.Enabled { ++ t.Skip("hash.Hash provided by boringcrypto are not comparable") ++ } + sha := sha256.New() + defer func() { + err := recover() + if err == nil { + t.Error("expected panic when calling New with a non-unique hash generation function") + } + }() + New(func() hash.Hash { return sha }, []byte("bytes")) + } + // justHash implements just the hash.Hash methods and nothing else type justHash struct { hash.Hash