Merge pull request #6496 from thomastaylor312/fix/digest_err

fix(provenance): Ports error check for `Digest` to v3
pull/6400/head
Taylor Thomas 5 years ago committed by GitHub
commit 1b9cc69da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
}

Loading…
Cancel
Save