From 6c3e393d4ea2e2d1c518433f5b74a4996dca3404 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Sun, 4 Jan 2009 16:27:50 -0500 Subject: Correct hashlib.md5 usage in tupkg and tupkgs. Signed-off-by: Loui Chang --- tupkg/client/tupkg | 2 +- tupkg/server/tupkgs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tupkg') diff --git a/tupkg/client/tupkg b/tupkg/client/tupkg index f9980e61..af7d0547 100755 --- a/tupkg/client/tupkg +++ b/tupkg/client/tupkg @@ -35,7 +35,7 @@ class ClientFile: self.makeMd5() def makeMd5(self): - md5sum = md5.new() + md5sum = md5() while self.fd.tell() != self.size: md5sum.update(self.fd.read(1024)) self.md5 = md5sum.hexdigest() diff --git a/tupkg/server/tupkgs b/tupkg/server/tupkgs index f70cb2f9..e43f15dd 100755 --- a/tupkg/server/tupkgs +++ b/tupkg/server/tupkgs @@ -51,14 +51,14 @@ class ClientFile: self.fd.seek(cur) def makeMd5(self): - md5sum = md5.new() + m = md5(); cur = self.fd.tell() self.getSize() self.fd.seek(0) while self.fd.tell() != self.size: - md5sum.update(self.fd.read(1024)) + m.update(self.fd.read(1024)) self.fd.seek(cur) - self.md5 = md5sum.hexdigest() + self.md5 = m.hexdigest() def finishDownload(self): self.fd.close() @@ -122,7 +122,7 @@ class ClientSocket(threading.Thread): db=config.get('mysql', 'db')) q = dbconn.cursor() - m = md5.new() + m = md5(); m.update(authdata['password'][0]) encpw = m.hexdigest() try: -- cgit v1.2.3-24-g4f1b