Skip to content

Commit

Permalink
Fix typo (again) in goodenough magic
Browse files Browse the repository at this point in the history
  • Loading branch information
deajan committed Mar 26, 2023
1 parent 4055c1c commit 5f59860
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cryptidy/aes_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def aes_encrypt(msg, aes_key):
return cipher.nonce, tag, ciphertext
except Exception as exc: # pylint: disable=W0703,broad-except
# goodenough(TM) Magic to avoid SyntaxError on PEP-0409 statements in Python < 3.3
err = 'raise ValueError("Encrypt failed: %s")'.format(exc)
err = 'raise ValueError("Encrypt failed: {}")'.format(exc)
if sys.version_info[0] < 3 or (
sys.version_info[0] == 3 and sys.version_info[1] < 4
):
Expand Down Expand Up @@ -109,7 +109,7 @@ def aes_decrypt(aes_key, nonce, tag, ciphertext):
return data
except Exception as exc: # pylint: disable=W0703,broad-except
# goodenough(TM) Magic to avoid SyntaxError on PEP-0409 statements in Python < 3.3
err = 'raise ValueError("Decrypt failed: %s")'.format(exc)
err = 'raise ValueError("Decrypt failed: {}")'.format(exc)
if sys.version_info[0] < 3 or (
sys.version_info[0] == 3 and sys.version_info[1] < 4
):
Expand Down
4 changes: 2 additions & 2 deletions cryptidy/asymmetric_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def rsa_encrypt_message(msg, public_key):
return enc_session_key + aes_encrypt_message(msg, session_key)
except Exception as exc: # pylint: disable=W0703,broad-except
# goodenough(TM) Magic to avoid SyntaxError on PEP-0409 statements in Python < 3.3
err = 'raise ValueError("Cannot RSA encrypt data: %s")'.format(exc)
err = 'raise ValueError("Cannot RSA encrypt data: {}")'.format(exc)
if sys.version_info[0] < 3 or (
sys.version_info[0] == 3 and sys.version_info[1] < 4
):
Expand Down Expand Up @@ -216,7 +216,7 @@ def rsa_decrypt_message(msg, private_key):
) # pylint: disable=W0707,raise-missing-from
except ValueError as exc:
# goodenough(TM) Magic to avoid SyntaxError on PEP-0409 statements in Python < 3.3
err = 'raise ValueError("RSA Integrity check failed, cannot decrypt data: %s")'.format(
err = 'raise ValueError("RSA Integrity check failed, cannot decrypt data: {}")'.format(
exc
)
if sys.version_info[0] < 3 or (
Expand Down
2 changes: 1 addition & 1 deletion cryptidy/symmetric_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def aes_decrypt_message(msg, aes_key):
return source_timestamp, data
except Exception as exc: # pylint: disable=W0703,broad-except
# goodenough(TM) Magic to avoid SyntaxError on PEP-0409 statements in Python < 3.3
err = 'raise ValueError("Cannot decrypt AES data: %s")'.format(exc)
err = 'raise ValueError("Cannot decrypt AES data: {}")'.format(exc)
if sys.version_info[0] < 3 or (
sys.version_info[0] == 3 and sys.version_info[1] < 4
):
Expand Down

0 comments on commit 5f59860

Please sign in to comment.