From ad405892ca09a6abe35c7c88f86f45c139e0d952 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 6 Mar 2022 17:07:17 +0100 Subject: [PATCH] rename KeyfileKeyBase -> FlexiKeyBase it is used as direct base class for both: - RepoKey - KeyfileKey --- src/borg/crypto/key.py | 6 +++--- src/borg/testsuite/archiver.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/borg/crypto/key.py b/src/borg/crypto/key.py index f49cd25b4..49cea56c0 100644 --- a/src/borg/crypto/key.py +++ b/src/borg/crypto/key.py @@ -527,7 +527,7 @@ class PassphraseKey: NAME = 'passphrase' -class KeyfileKeyBase(AESKeyBase): +class FlexiKeyBase(AESKeyBase): @classmethod def detect(cls, repository, manifest_data): key = cls(repository) @@ -640,7 +640,7 @@ class KeyfileKeyBase(AESKeyBase): raise NotImplementedError -class KeyfileKey(ID_HMAC_SHA_256, KeyfileKeyBase): +class KeyfileKey(ID_HMAC_SHA_256, FlexiKeyBase): TYPE = 0x00 TYPES_ACCEPTABLE = {TYPE} NAME = 'key file' @@ -731,7 +731,7 @@ class KeyfileKey(ID_HMAC_SHA_256, KeyfileKeyBase): self.target = target -class RepoKey(ID_HMAC_SHA_256, KeyfileKeyBase): +class RepoKey(ID_HMAC_SHA_256, FlexiKeyBase): TYPE = 0x03 TYPES_ACCEPTABLE = {TYPE, PassphraseKey.TYPE} NAME = 'repokey' diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index 58b760be3..5021b7aa7 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -36,7 +36,7 @@ from ..cache import Cache, LocalCache from ..chunker import has_seek_hole from ..constants import * # NOQA from ..crypto.low_level import bytes_to_long, num_cipher_blocks -from ..crypto.key import KeyfileKeyBase, RepoKey, KeyfileKey, Passphrase, TAMRequiredError +from ..crypto.key import FlexiKeyBase, RepoKey, KeyfileKey, Passphrase, TAMRequiredError from ..crypto.keymanager import RepoIdMismatch, NotABorgKeyFile from ..crypto.file_integrity import FileIntegrityError from ..helpers import Location, get_security_dir @@ -2850,7 +2850,7 @@ class ArchiverTestCase(ArchiverTestCaseBase): def raise_eof(*args): raise EOFError - with patch.object(KeyfileKeyBase, 'create', raise_eof): + with patch.object(FlexiKeyBase, 'create', raise_eof): self.cmd('init', '--encryption=repokey', self.repository_location, exit_code=1) assert not os.path.exists(self.repository_location)