diff --git a/src/borg/key.py b/src/borg/key.py index 018ef1ab0..05723ea35 100644 --- a/src/borg/key.py +++ b/src/borg/key.py @@ -142,7 +142,9 @@ class KeyBase: self.TYPE_STR = bytes([self.TYPE]) self.repository = repository self.target = None # key location file path / repo obj - self.compressor = Compressor('none') # for decompression + # Some commands write new chunks (e.g. rename) but don't take a --compression argument. This duplicates + # the default used by those commands who do take a --compression argument. + self.compressor = Compressor('lz4') self.decompress = self.compressor.decompress self.tam_required = True diff --git a/src/borg/testsuite/key.py b/src/borg/testsuite/key.py index dd3448c27..31e06f9dc 100644 --- a/src/borg/testsuite/key.py +++ b/src/borg/testsuite/key.py @@ -246,8 +246,9 @@ class TestKey: key = AuthenticatedKey.create(self.MockRepository(), self.MockArgs()) plaintext = Chunk(b'123456789') authenticated = key.encrypt(plaintext) - # 0x06 is the key TYPE, 0x0000 identifies CNONE compression - assert authenticated == b'\x06\x00\x00' + plaintext.data + # 0x06 is the key TYPE, 0x0100 identifies LZ4 compression, 0x90 is part of LZ4 and means that an uncompressed + # block of length nine follows (the plaintext). + assert authenticated == b'\x06\x01\x00\x90' + plaintext.data class TestPassphrase: