summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Waldmann <tw@waldmann-edv.de>2024-03-24 17:47:51 +0100
committerThomas Waldmann <tw@waldmann-edv.de>2024-03-28 14:44:38 +0100
commited80bf2c37f27ff0cf230182ad3f028e665e308e (patch)
tree55095b74f885cc920be78b08023e73b03f13510a
parent864357675507f7c2760d93f8b96da661efa0fad5 (diff)
do a late lookup on helpers.workarounds
so we can modify it within borg code elsewhere and it will get the updated value when it accesses the attribute.
-rw-r--r--src/borg/crypto/key.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/borg/crypto/key.py b/src/borg/crypto/key.py
index 5def0caba..0a634ba23 100644
--- a/src/borg/crypto/key.py
+++ b/src/borg/crypto/key.py
@@ -13,6 +13,7 @@ from ..logger import create_logger
logger = create_logger()
+from .. import helpers
from ..constants import * # NOQA
from ..compress import Compressor
from ..helpers import StableDict
@@ -23,7 +24,6 @@ from ..helpers import get_limited_unpacker
from ..helpers import bin_to_hex
from ..helpers import prepare_subprocess_env
from ..helpers import msgpack
-from ..helpers import workarounds
from ..item import Key, EncryptedKey
from ..platform import SaveFile
@@ -33,7 +33,7 @@ from .low_level import AES256_CTR_HMAC_SHA256, AES256_CTR_BLAKE2b
# workaround for lost passphrase or key in "authenticated" or "authenticated-blake2" mode
-AUTHENTICATED_NO_KEY = 'authenticated_no_key' in workarounds
+AUTHENTICATED_NO_KEY = 'authenticated_no_key' in helpers.workarounds
class NoPassphraseFailure(Error):
@@ -331,7 +331,7 @@ class KeyBase:
tam_key = self._tam_key(tam_salt, context=b'archive')
calculated_hmac = hmac.digest(tam_key, data, 'sha512')
if not hmac.compare_digest(calculated_hmac, tam_hmac):
- if 'ignore_invalid_archive_tam' in workarounds:
+ if 'ignore_invalid_archive_tam' in helpers.workarounds:
logger.debug('ignoring invalid archive TAM due to BORG_WORKAROUNDS')
return unpacked, False, None # same as if no TAM is present
else: