fix some stuff
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-04-26 17:15:54 +02:00
parent 58606caf3f
commit e8ab5d0ddd
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -76,13 +76,11 @@ class NetWrapper:
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') 'UTF-8')
self.network.send_msg(self.serverAddr, sendjson) self.network.send_msg(self.serverAddr, sendjson)
b64 = {'source': '', 'type': ''} try:
while not (b64['source'] == self.serverAddr and b64['type'] == 'AUT'):
status, msg = self.network.receive_msg(blocking=True) status, msg = self.network.receive_msg(blocking=True)
if not status: if not status:
raise Exception('Network error during connection.') raise Exception('Network error during connection.')
b64 = json.loads(msg.decode('UTF-8')) b64 = json.loads(msg.decode('UTF-8'))
try:
retnonce = b64decode(b64['nonce']) retnonce = b64decode(b64['nonce'])
retciphertext = b64decode(b64['message']) retciphertext = b64decode(b64['message'])
retcipher = ChaCha20_Poly1305.new(key=self.cipherkey, nonce=retnonce) retcipher = ChaCha20_Poly1305.new(key=self.cipherkey, nonce=retnonce)