From e8ab5d0ddd3b442a3a5dd84f7b6a82be7133ba19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Mon, 26 Apr 2021 17:15:54 +0200 Subject: [PATCH] fix some stuff --- client/netwrapper.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/netwrapper.py b/client/netwrapper.py index 73ad464..48f94c5 100644 --- a/client/netwrapper.py +++ b/client/netwrapper.py @@ -76,13 +76,11 @@ class NetWrapper: sendjson = json.dumps({'header': b64encode(header).decode('UTF-8'), 'nonce': nonce, 'message': ct, 'tag': b64tag}).encode( 'UTF-8') self.network.send_msg(self.serverAddr, sendjson) - b64 = {'source': '', 'type': ''} - while not (b64['source'] == self.serverAddr and b64['type'] == 'AUT'): + try: status, msg = self.network.receive_msg(blocking=True) if not status: raise Exception('Network error during connection.') b64 = json.loads(msg.decode('UTF-8')) - try: retnonce = b64decode(b64['nonce']) retciphertext = b64decode(b64['message']) retcipher = ChaCha20_Poly1305.new(key=self.cipherkey, nonce=retnonce)