better append to dict
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-04-26 21:52:11 +02:00
parent 101a8ab8d6
commit 90969aeadb
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

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