From 4ec17d969c7706dd3394070135ec4ab22a6de221 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 4 Aug 2022 10:16:54 +0200 Subject: [PATCH] rename --copy-ae-key into --copy-crypt-key --- src/borg/archiver/rcreate.py | 11 ++++++----- src/borg/crypto/key.py | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/borg/archiver/rcreate.py b/src/borg/archiver/rcreate.py index 24dbb0070..1c45784c3 100644 --- a/src/borg/archiver/rcreate.py +++ b/src/borg/archiver/rcreate.py @@ -22,7 +22,7 @@ class RCreateMixIn: path = args.location.canonical_path() logger.info('Initializing repository at "%s"' % path) if other_key is not None: - other_key.copy_ae_key = args.copy_ae_key + other_key.copy_crypt_key = args.copy_crypt_key try: key = key_creator(repository, args, other_key=other_key) except (EOFError, KeyboardInterrupt): @@ -160,7 +160,7 @@ class RCreateMixIn: By default, only the ID key and chunker secret will be the same (these are important for deduplication) and the AE crypto keys will be newly generated random keys. - Optionally, if you use ``--copy-ae-key`` you can also keep the same AE crypto keys + Optionally, if you use ``--copy-crypt-key`` you can also keep the same crypt_key (used for authenticated encryption). Might be desired e.g. if you want to have less keys to manage. @@ -218,8 +218,9 @@ class RCreateMixIn: help="create the parent directories of the repository directory, if they are missing.", ) subparser.add_argument( - "--copy-ae-key", - dest="copy_ae_key", + "--copy-crypt-key", + dest="copy_crypt_key", action="store_true", - help="copy the authenticated encryption (AE) key from the key of the other repo (default: new random key).", + help="copy the crypt_key (used for authenticated encryption) from the key of the other repo " + "(default: new random key).", ) diff --git a/src/borg/crypto/key.py b/src/borg/crypto/key.py index 4e0e598c4..0ea4a3813 100644 --- a/src/borg/crypto/key.py +++ b/src/borg/crypto/key.py @@ -191,7 +191,7 @@ class KeyBase: self.compressor = Compressor("lz4") self.decompress = self.compressor.decompress self.tam_required = True - self.copy_ae_key = False + self.copy_crypt_key = False def id_hash(self, data): """Return HMAC hash using the "id" HMAC key""" @@ -603,7 +603,7 @@ class FlexiKey: raise Error("Copying key material to an AES-CTR based mode is insecure and unsupported.") if not uses_same_id_hash(other_key, key): raise Error("You must keep the same ID hash (HMAC-SHA256 or BLAKE2b) or deduplication will break.") - if other_key.copy_ae_key: + if other_key.copy_crypt_key: # give the user the option to use the same authenticated encryption (AE) key crypt_key = other_key.crypt_key else: