shared/net: Fix hash matching

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
This commit is contained in:
Thomas Hipp 2018-12-20 20:59:34 +01:00
parent 663e5bff80
commit 9f09f83c14
No known key found for this signature in database
GPG Key ID: 993408D1137B7D51

View File

@ -43,6 +43,8 @@ func DownloadHash(file, checksum string, hashFunc hash.Hash) error {
defer image.Close()
if checksum != "" {
hashFunc.Reset()
_, err = io.Copy(hashFunc, image)
if err != nil {
return err