diff --git a/monkey/monkey_island/cc/services/utils/config_encryption.py b/monkey/monkey_island/cc/services/utils/config_encryption.py index 73c3ea893..70c1e12ee 100644 --- a/monkey/monkey_island/cc/services/utils/config_encryption.py +++ b/monkey/monkey_island/cc/services/utils/config_encryption.py @@ -27,9 +27,9 @@ def encrypt_config(config: Dict, password: str) -> str: return ciphertext_b64.decode() -def decrypt_config(cyphertext: str, password: str) -> Dict: - cyphertext = base64.b64decode(cyphertext) - ciphertext_config_stream = io.BytesIO(cyphertext) +def decrypt_config(ciphertext: str, password: str) -> Dict: + ciphertext = base64.b64decode(ciphertext) + ciphertext_config_stream = io.BytesIO(ciphertext) dec_plaintext_config_stream = io.BytesIO() len_ciphertext_config_stream = len(ciphertext_config_stream.getvalue()) diff --git a/monkey/tests/unit_tests/monkey_island/cc/resources/test_configuration_import.py b/monkey/tests/unit_tests/monkey_island/cc/resources/test_configuration_import.py index 1a41b0a51..1cfd6b914 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/resources/test_configuration_import.py +++ b/monkey/tests/unit_tests/monkey_island/cc/resources/test_configuration_import.py @@ -1,8 +1,8 @@ import json import pytest -from tests.unit_tests.monkey_island.cc.services.utils.cyphertexts_for_encryption_test import ( - MALFORMED_CYPHER_TEXT_CORRUPTED, +from tests.unit_tests.monkey_island.cc.services.utils.ciphertexts_for_encryption_test import ( + MALFORMED_CIPHER_TEXT_CORRUPTED, ) from tests.unit_tests.monkey_island.cc.services.utils.test_config_encryption import PASSWORD @@ -23,7 +23,7 @@ def test_is_config_encrypted__ciphertext(monkey_config): def test_is_config_encrypted__corrupt_ciphertext(): with pytest.raises(InvalidConfigurationError): - assert ConfigurationImport.is_config_encrypted(MALFORMED_CYPHER_TEXT_CORRUPTED) + assert ConfigurationImport.is_config_encrypted(MALFORMED_CIPHER_TEXT_CORRUPTED) def test_is_config_encrypted__unknown_format(): diff --git a/monkey/tests/unit_tests/monkey_island/cc/services/utils/cyphertexts_for_encryption_test.py b/monkey/tests/unit_tests/monkey_island/cc/services/utils/ciphertexts_for_encryption_test.py similarity index 99% rename from monkey/tests/unit_tests/monkey_island/cc/services/utils/cyphertexts_for_encryption_test.py rename to monkey/tests/unit_tests/monkey_island/cc/services/utils/ciphertexts_for_encryption_test.py index e4aa11b06..b35513a2a 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/services/utils/cyphertexts_for_encryption_test.py +++ b/monkey/tests/unit_tests/monkey_island/cc/services/utils/ciphertexts_for_encryption_test.py @@ -1,4 +1,4 @@ -MALFORMED_CYPHER_TEXT_CORRUPTED = ( +MALFORMED_CIPHER_TEXT_CORRUPTED = ( "QUVTAgAAGM0NKEYTESTURfQlkAcHlBZXNDcnlwdCA2LjAuMACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEWlHUF5GTDFdrlGaUbFqGOBHE" diff --git a/monkey/tests/unit_tests/monkey_island/cc/services/utils/test_config_encryption.py b/monkey/tests/unit_tests/monkey_island/cc/services/utils/test_config_encryption.py index 59d189ffa..fb7dcb929 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/services/utils/test_config_encryption.py +++ b/monkey/tests/unit_tests/monkey_island/cc/services/utils/test_config_encryption.py @@ -1,6 +1,6 @@ import pytest -from tests.unit_tests.monkey_island.cc.services.utils.cyphertexts_for_encryption_test import ( - MALFORMED_CYPHER_TEXT_CORRUPTED, +from tests.unit_tests.monkey_island.cc.services.utils.ciphertexts_for_encryption_test import ( + MALFORMED_CIPHER_TEXT_CORRUPTED, ) from monkey_island.cc.services.utils.config_encryption import ( @@ -28,7 +28,7 @@ def test_encrypt_decrypt_config__wrong_password(monkey_config): def test_encrypt_decrypt_config__malformed_corrupted(): with pytest.raises(ValueError): - decrypt_config(MALFORMED_CYPHER_TEXT_CORRUPTED, PASSWORD) + decrypt_config(MALFORMED_CIPHER_TEXT_CORRUPTED, PASSWORD) def test_encrypt_decrypt_config__decrypt_no_password(monkey_config):