TestNonUniqueHash will not work on boringcrypto because
the hash.Hash that sha256 provides is noncomparable.
Change-Id: Ie3dc2d5d775953c381674e22272cb3433daa1b31
package hmac
import (
+ "bytes"
++ "crypto/internal/boring"
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
}
}
+ 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