1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-23 08:16:54 +00:00

fix traceback in Error handler if id is None, fixes #1894

This commit is contained in:
Thomas Waldmann 2016-11-29 01:34:11 +01:00
parent 619cb123e5
commit cd50e286f7

View file

@ -105,7 +105,8 @@ def encrypt(self, data):
def decrypt(self, id, data):
if data[0] != self.TYPE:
raise IntegrityError('Chunk %s: Invalid encryption envelope' % bin_to_hex(id))
id_str = bin_to_hex(id) if id is not None else '(unknown)'
raise IntegrityError('Chunk %s: Invalid encryption envelope' % id_str)
data = self.compressor.decompress(memoryview(data)[1:])
if id and sha256(data).digest() != id:
raise IntegrityError('Chunk %s: id verification failed' % bin_to_hex(id))