Skip to content

Commit

Permalink
Bumping pycryptodome (jupyter-server#322)
Browse files Browse the repository at this point in the history
* bump pycryptodome

* encode strings for shared keys
  • Loading branch information
Zsailer authored and GitHub Enterprise committed Apr 13, 2022
1 parent f37adbf commit 9f625f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions data_studio_jupyter_extensions/configurables/session_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 9f625f4

Please sign in to comment.