From 9f625f46ec595106b1f629f32d0b6a2e63e102b9 Mon Sep 17 00:00:00 2001 From: Zachary Sailer Date: Tue, 12 Apr 2022 17:11:06 -0700 Subject: [PATCH] Bumping pycryptodome (#322) * bump pycryptodome * encode strings for shared keys --- build.sh | 1 + .../configurables/session_key.py | 8 ++++++-- setup.cfg | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 5b4c83acb6..29df41f7b0 100755 --- a/build.sh +++ b/build.sh @@ -54,6 +54,7 @@ EOF make install-dev if [[ $1 == "build" ]]; then + pip list make test tbump --only-patch --non-interactive 100.100.100 elif [[ $1 == "publish" ]]; then diff --git a/data_studio_jupyter_extensions/configurables/session_key.py b/data_studio_jupyter_extensions/configurables/session_key.py index e36f11810b..59863ab61c 100644 --- a/data_studio_jupyter_extensions/configurables/session_key.py +++ b/data_studio_jupyter_extensions/configurables/session_key.py @@ -51,8 +51,12 @@ def generate_session_key(self, process_id: str) -> str: data = ( process_id + chr(length) * length ) # padding so that the data is a multiple of block size - aes = AES.new(self.shared_encrypt_key, AES.MODE_CBC, self.shared_seed) - return b64encode(aes.encrypt(data)).decode("utf-8") + aes = AES.new( + self.shared_encrypt_key.encode("utf-8"), + AES.MODE_CBC, + self.shared_seed.encode("utf-8"), + ) + return b64encode(aes.encrypt(data.encode("utf-8"))).decode("utf-8") else: self.log.info( f"Using default session_key to connect to running kernel for {process_id}" diff --git a/setup.cfg b/setup.cfg index dd288e09d3..537fb6c36b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,7 +29,7 @@ install_requires = kubernetes_asyncio importlib_metadata jupyter_client~=7.1.2 - pycryptodome~=3.0.0 + pycryptodome~=3.14.1 [options.entry_points] jupyter_client.kernel_provisioners =