From 621c59dce27b315935ce2af2e62a0674f861fae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Sun, 25 Apr 2021 18:05:49 +0200 Subject: [PATCH] fix decode --- server/authentication.py | 2 +- server/netwrapper.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/authentication.py b/server/authentication.py index dbc5e17..ee2e7f4 100644 --- a/server/authentication.py +++ b/server/authentication.py @@ -13,7 +13,7 @@ from Crypto.PublicKey import RSA from Crypto.PublicKey.RSA import RsaKey auth_logger = logging.getLogger('AUTH APPLICATION ') -auth_logger.root.setLevel(logging.INFO) +auth_logger.setLevel(logging.INFO) class Authetication: ABSOLUTE_PATH = os.path.abspath(os.path.dirname(sys.argv[0])) diff --git a/server/netwrapper.py b/server/netwrapper.py index cae72f6..d94b982 100644 --- a/server/netwrapper.py +++ b/server/netwrapper.py @@ -36,8 +36,8 @@ class NetWrapper: cipher = PKCS1_OAEP.new(self.currentClientPublicKey) identMsg = json.dumps( {'type': 'IDY', 'source': self.network.own_addr, - 'message': b64encode(cipher.encrypt(retmsg.encode('UTF-8')))}).decode( - 'ASCII') + 'message': b64encode(cipher.encrypt(retmsg.encode('UTF-8'))).decode('ASCII')}).encode( + 'UTF-8') self.network.send_msg(self.clientAddr, identMsg) def sendMessage(self, message: bytes) -> None: