mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Correct hashlib.md5 usage in tupkg and tupkgs.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
parent
207b565f1c
commit
6c3e393d4e
2 changed files with 5 additions and 5 deletions
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue