| |
@@ -31,6 +31,7 @@
|
| |
import fcntl
|
| |
import fnmatch
|
| |
import functools
|
| |
+ import hashlib
|
| |
import json
|
| |
import logging
|
| |
import os
|
| |
@@ -61,11 +62,9 @@
|
| |
from koji.util import base64encode
|
| |
from koji.util import decode_bytes
|
| |
from koji.util import dslice
|
| |
- from koji.util import md5_constructor
|
| |
from koji.util import move_and_symlink
|
| |
from koji.util import multi_fnmatch
|
| |
from koji.util import safer_move
|
| |
- from koji.util import sha1_constructor
|
| |
from koji.util import to_list
|
| |
from six.moves import range
|
| |
logger = logging.getLogger('koji.hub')
|
| |
@@ -5936,7 +5935,7 @@
|
| |
# until we change the way we handle checksums, we have to limit this to md5
|
| |
raise koji.GenericError("Unsupported checksum type: %(checksum_type)s" % fileinfo)
|
| |
with open(path, 'rb') as fp:
|
| |
- m = md5_constructor()
|
| |
+ m = hashlib.md5()
|
| |
while True:
|
| |
contents = fp.read(8192)
|
| |
if not contents:
|
| |
@@ -6477,7 +6476,7 @@
|
| |
# trust values computed on hub (CG_Importer.prep_outputs)
|
| |
if not fileinfo or not fileinfo.get('hub.checked_md5'):
|
| |
with open(filepath, 'rb') as archivefp:
|
| |
- m = md5_constructor()
|
| |
+ m = hashlib.md5()
|
| |
while True:
|
| |
contents = archivefp.read(8192)
|
| |
if not contents:
|
| |
@@ -6612,7 +6611,7 @@
|
| |
continue
|
| |
if not os.path.isfile('%s/%s' % (mavendir, mavenfile)):
|
| |
continue
|
| |
- for ext, sum_constr in (('.md5', md5_constructor), ('.sha1', sha1_constructor)):
|
| |
+ for ext, sum_constr in (('.md5', hashlib.md5), ('.sha1', hashlib.sha1)):
|
| |
sumfile = mavenfile + ext
|
| |
if sumfile not in mavenfiles:
|
| |
sum = sum_constr()
|
| |
@@ -6661,7 +6660,7 @@
|
| |
#we use the sigkey='' to represent unsigned in the db (so that uniqueness works)
|
| |
else:
|
| |
sigkey = koji.get_sigpacket_key_id(sigkey)
|
| |
- sighash = md5_constructor(sighdr).hexdigest()
|
| |
+ sighash = hashlib.md5(sighdr).hexdigest()
|
| |
rpm_id = rinfo['id']
|
| |
# - db entry
|
| |
q = """SELECT sighash FROM rpmsigs WHERE rpm_id=%(rpm_id)i AND sigkey=%(sigkey)s"""
|
| |
@@ -13212,7 +13211,7 @@
|
| |
|
| |
def get_verify_class(verify):
|
| |
if verify == 'md5':
|
| |
- return md5_constructor
|
| |
+ return hashlib.md5
|
| |
elif verify == 'adler32':
|
| |
return koji.util.adler32_constructor
|
| |
elif verify:
|
| |
These functions are now fully provided by hashlib. Commit removes their
usage from koji's codebase and leaves deprecation message in lib.
Final removal from lib is scheduled to 1.21.
Fixes: https://pagure.io/koji/issue/1487