From a8730ceac3515a0c8e75dbcf04412bf6df03ceed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Mon, 26 Apr 2021 17:19:36 +0200 Subject: [PATCH] foggyos vagyok --- server/netwrapper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/netwrapper.py b/server/netwrapper.py index 4973ed4..e54eb50 100644 --- a/server/netwrapper.py +++ b/server/netwrapper.py @@ -49,7 +49,8 @@ class NetWrapper: nonce = b64encode(cipher.nonce).decode('UTF-8') ct = b64encode(ciphertext).decode('UTF-8') b64tag = b64encode(tag).decode('UTF-8') - sendjson = json.dumps({'header': b64encode(header).decode('UTF-8'), 'nonce': nonce, 'message': ct, 'tag': b64tag}).encode( + sendjson = json.dumps( + {'header': b64encode(header).decode('UTF-8'), 'nonce': nonce, 'message': ct, 'tag': b64tag}).encode( 'UTF-8') self.network.send_msg(self.clientAddr, sendjson) @@ -94,7 +95,7 @@ class NetWrapper: message = "OK".encode('UTF-8') else: message = "ERROR".encode('UTF-8') - header = json.dumps({'source': self.network.own_addr, 'type': 'CMD'}).encode('UTF-8') + header = json.dumps({'source': self.network.own_addr, 'type': 'AUT'}).encode('UTF-8') cipher = ChaCha20_Poly1305.new(key=self.cipherkey) cipher.update(header) ciphertext, tag = cipher.encrypt_and_digest(message)