Browse Source

fix traceback when trying to do unsupported passphrase change, fixes #189

Thomas Waldmann 10 years ago
parent
commit
be29e5f6f4
1 changed files with 6 additions and 0 deletions
  1. 6 0
      attic/key.py

+ 6 - 0
attic/key.py

@@ -190,6 +190,12 @@ class PassphraseKey(AESKeyBase):
             except IntegrityError:
             except IntegrityError:
                 passphrase = getpass(prompt)
                 passphrase = getpass(prompt)
 
 
+    def change_passphrase(self):
+        class ImmutablePassphraseError(Error):
+            """The passphrase for this encryption key type can't be changed."""
+
+        raise ImmutablePassphraseError
+
     def init(self, repository, passphrase):
     def init(self, repository, passphrase):
         self.init_from_random_data(pbkdf2_sha256(passphrase.encode('utf-8'), repository.id, self.iterations, 100))
         self.init_from_random_data(pbkdf2_sha256(passphrase.encode('utf-8'), repository.id, self.iterations, 100))
         self.init_ciphers()
         self.init_ciphers()