mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-24 08:45:13 +00:00
remove support for shake_* hashes, fixes #6082
This commit is contained in:
parent
3a878bb13c
commit
6226002eb0
1 changed files with 6 additions and 4 deletions
|
@ -672,7 +672,9 @@ def format_time(self, ts):
|
|||
|
||||
|
||||
class ItemFormatter(BaseFormatter):
|
||||
hash_algorithms = hashlib.algorithms_guaranteed.union({'xxh64'})
|
||||
# we provide the hash algos from python stdlib (except shake_*) and additionally xxh64.
|
||||
# shake_* is not provided because it uses an incompatible .digest() method to support variable length.
|
||||
hash_algorithms = hashlib.algorithms_guaranteed.union({'xxh64'}).difference({'shake_128', 'shake_256'})
|
||||
KEY_DESCRIPTIONS = {
|
||||
'bpath': 'verbatim POSIX path, can contain any character except NUL',
|
||||
'path': 'path interpreted as text (might be missing non-text characters, see bpath)',
|
||||
|
@ -836,10 +838,10 @@ def calculate_csize(self, item):
|
|||
def hash_item(self, hash_function, item):
|
||||
if 'chunks' not in item:
|
||||
return ""
|
||||
if hash_function in hashlib.algorithms_guaranteed:
|
||||
hash = hashlib.new(hash_function)
|
||||
elif hash_function == 'xxh64':
|
||||
if hash_function == 'xxh64':
|
||||
hash = self.xxh64()
|
||||
elif hash_function in self.hash_algorithms:
|
||||
hash = hashlib.new(hash_function)
|
||||
for data in self.archive.pipeline.fetch_many([c.id for c in item.chunks]):
|
||||
hash.update(data)
|
||||
return hash.hexdigest()
|
||||
|
|
Loading…
Reference in a new issue