diff --git a/monkey/monkey_island.py b/monkey/monkey_island.py index e2323a7c3..1261af888 100644 --- a/monkey/monkey_island.py +++ b/monkey/monkey_island.py @@ -6,10 +6,6 @@ gevent_monkey.patch_all() import json # noqa: E402 -from monkey_island.cc.consts import ( - DEFAULT_SERVER_CONFIG_PATH, - DEFAULT_LOGGER_CONFIG_PATH, -) # noqa: E402 from monkey_island.cc.island_logger import json_setup_logging # noqa: E402 diff --git a/monkey/monkey_island/cc/environment/test_environment_config.py b/monkey/monkey_island/cc/environment/test_environment_config.py index cee36645b..de941a6f3 100644 --- a/monkey/monkey_island/cc/environment/test_environment_config.py +++ b/monkey/monkey_island/cc/environment/test_environment_config.py @@ -26,6 +26,7 @@ STANDARD_WITH_CREDENTIALS = os.path.join( WITH_DATA_DIR = os.path.join(TEST_RESOURCES_DIR, "server_config_with_data_dir.json") WITH_DATA_DIR_HOME = os.path.join(TEST_RESOURCES_DIR, "server_config_with_data_dir_home.json") + @pytest.fixture def config_file(tmpdir): return os.path.join(tmpdir, "test_config.json") diff --git a/monkey/monkey_island/cc/server_utils/encryptor.py b/monkey/monkey_island/cc/server_utils/encryptor.py index 162efd15e..161032c52 100644 --- a/monkey/monkey_island/cc/server_utils/encryptor.py +++ b/monkey/monkey_island/cc/server_utils/encryptor.py @@ -38,7 +38,7 @@ class Encryptor: ) def _unpad(self, message: str): - return message[0 : -ord(message[len(message) - 1])] + return message[0:-ord(message[len(message) - 1])] def enc(self, message: str): cipher_iv = Random.new().read(AES.block_size) @@ -49,9 +49,9 @@ class Encryptor: def dec(self, enc_message): enc_message = base64.b64decode(enc_message) - cipher_iv = enc_message[0 : AES.block_size] + cipher_iv = enc_message[0:AES.block_size] cipher = AES.new(self._cipher_key, AES.MODE_CBC, cipher_iv) - return self._unpad(cipher.decrypt(enc_message[AES.block_size :]).decode()) + return self._unpad(cipher.decrypt(enc_message[AES.block_size:]).decode()) def initialize_encryptor(password_file_dir):