1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-07 06:59:38 +00:00

remove support for --encryption=passphrase, clean up

This commit is contained in:
Thomas Waldmann 2016-01-15 06:58:41 +01:00
parent 2f9b643edb
commit 815d2e23ce
2 changed files with 9 additions and 10 deletions

View file

@ -802,8 +802,6 @@ def build_parser(self, args=None, prog=None):
This command initializes an empty repository. A repository is a filesystem
directory containing the deduplicated data from zero or more archives.
Encryption can be enabled at repository init time.
Please note that the 'passphrase' encryption mode is DEPRECATED (instead of it,
consider using 'repokey').
""")
subparser = subparsers.add_parser('init', parents=[common_parser],
description=self.do_init.__doc__, epilog=init_epilog,
@ -813,7 +811,7 @@ def build_parser(self, args=None, prog=None):
type=location_validator(archive=False),
help='repository to create')
subparser.add_argument('-e', '--encryption', dest='encryption',
choices=('none', 'keyfile', 'repokey', 'passphrase'), default='repokey',
choices=('none', 'keyfile', 'repokey'), default='repokey',
help='select encryption key mode (default: "%(default)s")')
check_epilog = textwrap.dedent("""

View file

@ -35,8 +35,6 @@ def key_creator(repository, args):
return KeyfileKey.create(repository, args)
elif args.encryption == 'repokey':
return RepoKey.create(repository, args)
elif args.encryption == 'passphrase': # deprecated, kill in 1.x
return PassphraseKey.create(repository, args)
else:
return PlaintextKey.create(repository, args)
@ -48,8 +46,8 @@ def key_factory(repository, manifest_data):
elif key_type == RepoKey.TYPE:
return RepoKey.detect(repository, manifest_data)
elif key_type == PassphraseKey.TYPE:
# this mode was killed in borg 1.0, see: https://github.com/borgbackup/borg/issues/97
# we just dispatch to repokey mode and assume the passphrase was migrated to a repokey.
# see also comment in PassphraseKey class.
return RepoKey.detect(repository, manifest_data)
elif key_type == PlaintextKey.TYPE:
return PlaintextKey.detect(repository, manifest_data)
@ -207,18 +205,21 @@ def kdf(self, salt, iterations, length):
class PassphraseKey(AESKeyBase):
# This mode is DEPRECATED and will be killed at 1.0 release.
# With this mode:
# This mode was killed in borg 1.0, see: https://github.com/borgbackup/borg/issues/97
# Reasons:
# - you can never ever change your passphrase for existing repos.
# - you can never ever use a different iterations count for existing repos.
# "Killed" means:
# - there is no automatic dispatch to this class via type byte
# - --encryption=passphrase is an invalid argument now
# This class is kept for a while to support migration from passphrase to repokey mode.
TYPE = 0x01
iterations = 100000 # must not be changed ever!
@classmethod
def create(cls, repository, args):
key = cls(repository)
logger.warning('WARNING: "passphrase" mode is deprecated and will be removed in 1.0.')
logger.warning('If you want something similar (but with less issues), use "repokey" mode.')
logger.warning('WARNING: "passphrase" mode is unsupported since borg 1.0.')
passphrase = Passphrase.new(allow_empty=False)
key.init(repository, passphrase)
return key