From b4a9ccb3342ded3810db08831baa777b4f65d764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Mon, 26 Apr 2021 22:06:07 +0200 Subject: [PATCH] szezon meg a fazon --- server/netwrapper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/netwrapper.py b/server/netwrapper.py index a09cc71..7edd4bb 100644 --- a/server/netwrapper.py +++ b/server/netwrapper.py @@ -52,6 +52,9 @@ class NetWrapper: def serverIdentify(self, msg: bytes) -> None: incommingJson = json.loads(msg.decode('UTF-8')) header = json.loads(b64decode(incommingJson['header']).decode('UTF-8')) + self.clientAddr = header['source'] + self.currentUser = header['username'] + self.currentClientPublicKey = self.clientPublicKey[self.currentUser] try: if not self.verifyRSAHeaderSignature(b64decode(incommingJson['header']), b64decode(incommingJson['headersignature'])) or header[ @@ -59,9 +62,6 @@ class NetWrapper: raise Exception('Bad initial message') except Exception: raise Exception('Bad initial message') - self.clientAddr = header['source'] - self.currentUser = header['username'] - self.currentClientPublicKey = self.clientPublicKey[self.currentUser] retheader, retheadersignature = self.signRSAHeader("IDY", {}) retmsg = self.ecryptRSAMessage(b64decode(incommingJson['message']).decode('UTF-8')) identMsg = json.dumps(