Merge pull request #5672 from tariq1890/err_digest

add errcheck for Digest method in sign.go
pull/7605/head
Matthew Fisher 6 years ago committed by GitHub
commit 55e87b68bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -404,6 +404,8 @@ func DigestFile(filename string) (string, error) {
// Helm uses SHA256 as its default hash for all non-cryptographic applications. // Helm uses SHA256 as its default hash for all non-cryptographic applications.
func Digest(in io.Reader) (string, error) { func Digest(in io.Reader) (string, error) {
hash := crypto.SHA256.New() 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 return hex.EncodeToString(hash.Sum(nil)), nil
} }

Loading…
Cancel
Save