浏览代码

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

Thomas Waldmann 2 年之前
父节点
当前提交
a07c93d7f4
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/borg/crypto/key.py

+ 1 - 0
src/borg/crypto/key.py

@@ -110,6 +110,7 @@ def identify_key(manifest_data):
 
 def key_factory(repository, manifest_chunk, *, ro_cls=RepoObj):
     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)