From c843a4d2822c5d0fa44afe2086a12b2f9ad58688 Mon Sep 17 00:00:00 2001 From: Christoph Goehre Date: Mon, 21 Jan 2008 12:05:59 +0100 Subject: fix SHA256 hash generation without /usr/bin/sha256sum --- mini-dinstall | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mini-dinstall') diff --git a/mini-dinstall b/mini-dinstall index 92f3831..f3fc6d7 100755 --- a/mini-dinstall +++ b/mini-dinstall @@ -1172,14 +1172,14 @@ class ArchiveDirIndexer(threading.Thread): buf = f.read(8192) return shasum.hexdigest() elif type == 'sha256': - import Crypto.Hash.SHA256 + from Crypto.Hash import SHA256 f = open(filename) buf = f.read(8192) - shasum256 = SHA256.new(buf) + shasum256 = SHA256.new() while buf != '': - shasum256.hash_update(buf) + shasum256.update(buf) buf = f.read(8192) - return shasum256.hash_digest() + return shasum256.hexdigest() else: raise DinstallException('cannot compute hash of type %s; no builtin method or /usr/bin/%ssum', type, type) -- cgit v1.2.3