1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-26 16:04:06 +00:00

add assertion to key_factory, fail early with zero-len manifest data

This commit is contained in:
Thomas Waldmann 2022-09-21 09:06:59 +02:00
parent 8c9fed105d
commit a07c93d7f4

View file

@ -110,6 +110,7 @@ def identify_key(manifest_data):
def key_factory(repository, manifest_chunk, *, ro_cls=RepoObj): def key_factory(repository, manifest_chunk, *, ro_cls=RepoObj):
manifest_data = ro_cls.extract_crypted_data(manifest_chunk) manifest_data = ro_cls.extract_crypted_data(manifest_chunk)
assert manifest_data, "manifest data must not be zero bytes long"
return identify_key(manifest_data).detect(repository, manifest_data) return identify_key(manifest_data).detect(repository, manifest_data)