diff --git a/pkg/provenance/sign.go b/pkg/provenance/sign.go index 469205527..6e828ff5d 100644 --- a/pkg/provenance/sign.go +++ b/pkg/provenance/sign.go @@ -402,6 +402,8 @@ func DigestFile(filename string) (string, error) { // Helm uses SHA256 as its default hash for all non-cryptographic applications. func Digest(in io.Reader) (string, error) { hash := crypto.SHA256.New() - io.Copy(hash, in) + if _, err := io.Copy(hash, in); err != nil { + return "", nil + } return hex.EncodeToString(hash.Sum(nil)), nil }