From bca36db0a1c8e0de12ade11c564e01efb1318a6f Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 8 Sep 2022 23:27:19 +0200 Subject: [PATCH] transfer: fix csize/psize for obfuscated chunks --- src/borg/upgrade.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/borg/upgrade.py b/src/borg/upgrade.py index 6a9fd4460..b0c608a52 100644 --- a/src/borg/upgrade.py +++ b/src/borg/upgrade.py @@ -123,8 +123,10 @@ def upgrade_zlib_and_level(meta, data): csize = borg1_header_fmt.unpack(csize_bytes) compressed = data[2 + hlen : 2 + hlen + csize] meta, compressed = upgrade_zlib_and_level(meta, compressed) + meta["psize"] = csize osize = len(data) - 2 - hlen - csize # amount of 0x00 bytes appended for obfuscation data = compressed + bytes(osize) + meta["csize"] = len(data) else: meta, data = upgrade_zlib_and_level(meta, data) return meta, data