mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Merge pull request #993 from joshuagl/joshuagl/quickblake
Support blake algorithms for file hashing
This commit is contained in:
commit
ba57da0bb8
2 changed files with 6 additions and 2 deletions
|
|
@ -974,7 +974,7 @@ def get_metadata_fileinfo(filename, custom=None):
|
|||
# file information, such as the file's author, version/revision
|
||||
# numbers, etc.
|
||||
filesize, filehashes = securesystemslib.util.get_file_details(filename,
|
||||
securesystemslib.settings.HASH_ALGORITHMS)
|
||||
tuf.settings.FILE_HASH_ALGORITHMS)
|
||||
|
||||
return tuf.formats.make_fileinfo(filesize, filehashes, custom=custom)
|
||||
|
||||
|
|
@ -1531,7 +1531,8 @@ def generate_timestamp_metadata(snapshot_filename, version, expiration_date,
|
|||
|
||||
# Retrieve the versioninfo of the Snapshot metadata file.
|
||||
snapshot_fileinfo = {}
|
||||
length, hashes = securesystemslib.util.get_file_details(snapshot_filename)
|
||||
length, hashes = securesystemslib.util.get_file_details(snapshot_filename,
|
||||
tuf.settings.FILE_HASH_ALGORITHMS)
|
||||
snapshot_version = get_metadata_versioninfo('snapshot', repository_name)
|
||||
snapshot_fileinfo[SNAPSHOT_FILENAME] = \
|
||||
tuf.formats.make_fileinfo(length, hashes, version=snapshot_version['version'])
|
||||
|
|
|
|||
|
|
@ -102,6 +102,9 @@
|
|||
# the securesystemslib external library.
|
||||
DEFAULT_HASH_ALGORITHM = 'sha256'
|
||||
|
||||
# The hashing algorithms used to compute file hashes
|
||||
FILE_HASH_ALGORITHMS = ['sha256', 'sha512']
|
||||
|
||||
# The client's update procedure (contained within a while-loop) can potentially
|
||||
# hog the CPU. The following setting can be used to force the update sequence
|
||||
# to suspend execution for a specified amount of time. See
|
||||
|
|
|
|||
Loading…
Reference in a new issue