a wrapper ignoring FIPS for hashlib.md5
This commit is contained in:
parent
0a61104280
commit
a893e8bf2b
9 changed files with 29 additions and 19 deletions
|
|
@ -2,7 +2,6 @@ from __future__ import absolute_import, division
|
|||
|
||||
import ast
|
||||
import fnmatch
|
||||
import hashlib
|
||||
import itertools
|
||||
import json
|
||||
import logging
|
||||
|
|
@ -24,7 +23,7 @@ import six.moves.xmlrpc_client
|
|||
from six.moves import filter, map, range, zip
|
||||
|
||||
import koji
|
||||
from koji.util import base64encode, to_list
|
||||
from koji.util import base64encode, md5_constructor, to_list
|
||||
from koji_cli.lib import (
|
||||
_,
|
||||
_list_tasks,
|
||||
|
|
@ -1500,7 +1499,7 @@ def handle_import_sig(goptions, session, args):
|
|||
previous = session.queryRPMSigs(rpm_id=rinfo['id'], sigkey=sigkey)
|
||||
assert len(previous) <= 1
|
||||
if previous:
|
||||
sighash = hashlib.md5(sighdr).hexdigest()
|
||||
sighash = md5_constructor(sighdr).hexdigest()
|
||||
if previous[0]['sighash'] == sighash:
|
||||
print(_("Signature already imported: %s") % path)
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ from six.moves import range
|
|||
import koji
|
||||
# import parse_arches to current namespace for backward compatibility
|
||||
from koji import parse_arches
|
||||
from koji.util import to_list
|
||||
from koji.util import md5_constructor, to_list
|
||||
|
||||
try:
|
||||
import krbV
|
||||
|
|
@ -612,7 +612,7 @@ def download_archive(build, archive, topurl, quiet=False, noprogress=False):
|
|||
|
||||
# check checksum/checksum_type
|
||||
if archive['checksum_type'] == koji.CHECKSUM_TYPES['md5']:
|
||||
hash = hashlib.md5()
|
||||
hash = md5_constructor()
|
||||
elif archive['checksum_type'] == koji.CHECKSUM_TYPES['sha1']:
|
||||
hash = hashlib.sha1()
|
||||
elif archive['checksum_type'] == koji.CHECKSUM_TYPES['sha256']:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue