diff --git a/CHANGELOG.md b/CHANGELOG.md index 509a373..0884f11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +# v24.25.0 + +- Remove stray `\\n` characters from private and public keys when doing encryption/decryption, and replace with proper newlines + # v24.23.0 - Added new `cacheableVariables` option for transfers. This allows you to specify a list of variables that should be cached and written back to somewhere (depending on the `cachingPlugin` referenced). This is useful for dynamically updated variables that need to be stored centrally. For more detail see the `README.md`ß diff --git a/pyproject.toml b/pyproject.toml index e49755c..c29267a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "opentaskpy" -version = "v24.23.0" +version = "v24.25.0" authors = [{ name = "Adam McDonagh", email = "adam@elitemonkey.net" }] license = { text = "GPLv3" } classifiers = [ @@ -71,7 +71,7 @@ otf-batch-validator = "opentaskpy.cli.batch_validator:main" profile = 'black' [tool.bumpver] -current_version = "v24.23.0" +current_version = "v24.25.0" version_pattern = "vYY.WW.PATCH[-TAG]" commit_message = "bump version {old_version} -> {new_version}" commit = true diff --git a/src/opentaskpy/taskhandlers/transfer.py b/src/opentaskpy/taskhandlers/transfer.py index c83bf9d..b22838d 100644 --- a/src/opentaskpy/taskhandlers/transfer.py +++ b/src/opentaskpy/taskhandlers/transfer.py @@ -770,6 +770,9 @@ def encrypt_files( # Set up gnupg gpg = gnupg.GPG(gnupghome=f"{tmpdir}/.gnupg") + # Remove any escaped newline characters from the key + public_key = public_key.replace("\\n", "\n") + # Load the public key import_result = gpg.import_keys(public_key) @@ -847,6 +850,8 @@ def decrypt_files(self, files: dict, private_key: str) -> dict: # Set up gnupg gpg = gnupg.GPG(gnupghome=f"{tmpdir}/.gnupg") + private_key = private_key.replace("\\n", "\n") + # Load the private key import_result = gpg.import_keys(private_key) # Check the key imported OK