mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-24 23:13:25 +00:00
bugfix: correctly give manifest id
but do not verify chunk-id for it (does not match because the ID is fixed at all-zero).
This commit is contained in:
parent
09e2afe951
commit
7083e6738f
2 changed files with 3 additions and 2 deletions
|
@ -18,6 +18,7 @@
|
|||
from ..helpers import bin_to_hex
|
||||
from ..helpers.passphrase import Passphrase, PasswordRetriesExceeded, PassphraseWrong
|
||||
from ..helpers import msgpack
|
||||
from ..helpers.manifest import Manifest
|
||||
from ..item import Key, EncryptedKey
|
||||
from ..platform import SaveFile
|
||||
|
||||
|
@ -165,7 +166,7 @@ def decrypt(self, id, data, decompress=True):
|
|||
pass
|
||||
|
||||
def assert_id(self, id, data):
|
||||
if id:
|
||||
if id and id != Manifest.MANIFEST_ID:
|
||||
id_computed = self.id_hash(data)
|
||||
if not hmac.compare_digest(id_computed, id):
|
||||
raise IntegrityError('Chunk %s: id verification failed' % bin_to_hex(id))
|
||||
|
|
|
@ -186,7 +186,7 @@ def load(cls, repository, operations, key=None, force_tam_not_required=False):
|
|||
if not key:
|
||||
key = key_factory(repository, cdata)
|
||||
manifest = cls(key, repository)
|
||||
data = key.decrypt(None, cdata)
|
||||
data = key.decrypt(cls.MANIFEST_ID, cdata)
|
||||
manifest_dict, manifest.tam_verified = key.unpack_and_verify_manifest(data, force_tam_not_required=force_tam_not_required)
|
||||
m = ManifestItem(internal_dict=manifest_dict)
|
||||
manifest.id = key.id_hash(data)
|
||||
|
|
Loading…
Reference in a new issue