diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index 13aeef04d..ff0095cb1 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -3507,12 +3507,20 @@ def test_do_not_mention_archive_if_you_can_not_find_repo(self): self.assert_not_in('this-repository-does-not-exist::test', output) def test_can_read_repo_even_if_nonce_is_deleted(self): + """Nonce is only used for encrypting new data. + + It should be possible to retrieve the data from an archive even if + both the client and the server forget the nonce""" self.create_regular_file('file1', contents=b'Hello, borg') self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') # Oops! We have removed the repo-side memory of the nonce! # See https://github.com/borgbackup/borg/issues/5858 os.remove(os.path.join(self.repository_path, 'nonce')) + # Oops! The client has lost the nonce too! + repository_id = bin_to_hex(self._extract_repository_id(self.repository_path)) + security_dir = get_security_dir(repository_id) + os.remove(os.path.join(security_dir, 'nonce')) # The repo should still be readable repo_info = self.cmd('info', self.repository_location)