fix some stuff
continuous-integration/drone/push Build is passing Details

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
1 changed files with 1 additions and 3 deletions

View File

@ -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)