From 90969aeadb74a39cba74a04a6cb81b62e9db822d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Mon, 26 Apr 2021 21:52:11 +0200 Subject: [PATCH] better append to dict --- server/netwrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/netwrapper.py b/server/netwrapper.py index 4146d2c..e33728e 100644 --- a/server/netwrapper.py +++ b/server/netwrapper.py @@ -31,7 +31,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.serverPrivateKey).sign(h) return header, headersignature