소스 검색

file_integrity: hash_part: mix length into state

Marian Beermann 8 년 전
부모
커밋
83bca02a4e
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/borg/crypto/file_integrity.py

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

@@ -152,6 +152,7 @@ class IntegrityCheckedFile(FileLikeWrapper):
     def hash_part(self, partname, is_final=False):
         if not self.writing and not self.digests:
             return
+        self.hasher.update(('%10d' % len(partname)).encode())
         self.hasher.update(partname.encode())
         self.hasher.hash_length(seek_to_end=is_final)
         digest = self.hasher.hexdigest()