1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-23 14:41:43 +00:00

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

This commit is contained in:
Thomas Waldmann 2015-03-08 04:19:25 +01:00
parent 4ab4ecc7af
commit be29e5f6f4

View file

@ -190,6 +190,12 @@ def detect(cls, repository, manifest_data):
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()