Browse Source

post-merge: re-enabled AuthenticatedKey and tests

Thomas Waldmann 8 years ago
parent
commit
1e23291b7f
2 changed files with 5 additions and 1 deletions
  1. 4 0
      src/borg/crypto/key.py
  2. 1 1
      src/borg/testsuite/key.py

+ 4 - 0
src/borg/crypto/key.py

@@ -802,6 +802,10 @@ class AuthenticatedKeyBase(RepoKey):
             raise IntegrityError('Manifest: Invalid encryption envelope')
         return 42
 
+    def init_ciphers(self, manifest_data=None):
+        if manifest_data is not None and manifest_data[0] != self.TYPE:
+            raise IntegrityError('Manifest: Invalid encryption envelope')
+
     def encrypt(self, chunk):
         data = self.compressor.compress(chunk)
         return b''.join([self.TYPE_STR, data])

+ 1 - 1
src/borg/testsuite/key.py

@@ -76,6 +76,7 @@ class TestKey:
         AuthenticatedKey,
         KeyfileKey,
         RepoKey,
+        AuthenticatedKey,
         # TODO temporarily disabled for branch merging XXX
         #Blake2KeyfileKey,
         #Blake2RepoKey,
@@ -258,7 +259,6 @@ class TestKey:
         with pytest.raises(IntegrityError):
             key.assert_id(id, plaintext_changed)
 
-    @pytest.mark.skip("temporarily disabled for branch merge")  # TODO
     def test_authenticated_encrypt(self, monkeypatch):
         monkeypatch.setenv('BORG_PASSPHRASE', 'test')
         key = AuthenticatedKey.create(self.MockRepository(), self.MockArgs())