fuxy wuxy
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-04-26 17:24:03 +02:00
parent 12dd07c749
commit ce4fd0cd30
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -123,6 +123,7 @@ class NetWrapper:
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)
retcipher.update(b64decode(b64['header']))
plaintext = retcipher.decrypt_and_verify(retciphertext, b64decode(b64['tag'])) plaintext = retcipher.decrypt_and_verify(retciphertext, b64decode(b64['tag']))
retheader = json.loads(b64decode(b64['header']).decode('UTF-8')) retheader = json.loads(b64decode(b64['header']).decode('UTF-8'))
if not (retheader['source'] == self.serverAddr and retheader['type'] == 'CMD'): if not (retheader['source'] == self.serverAddr and retheader['type'] == 'CMD'):