From 01e26bf6c55579272dd2344abf0c51ef83f1ec39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Mon, 26 Apr 2021 21:52:29 +0200 Subject: [PATCH] better append to dict --- client/netwrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/netwrapper.py b/client/netwrapper.py index a4246dd..8671fd1 100644 --- a/client/netwrapper.py +++ b/client/netwrapper.py @@ -32,7 +32,8 @@ class NetWrapper: return encrypted_msg def signRSAHeader(self, type: str, extradata: dict) -> (bytes, bytes): - header = json.dumps({'type': type, 'source': self.network.own_addr}.update(extradata)).encode('UTF-8') + mandatory = {'type': type, 'source': self.network.own_addr} + header = json.dumps({**mandatory, **extradata}).encode('UTF-8') h = SHA512.new(header) headersignature = pkcs1_15.new(self.privateKey).sign(h) return header, headersignature