This commit is contained in:
parent
d40b20e753
commit
b4a9ccb334
@ -52,6 +52,9 @@ class NetWrapper:
|
||||
def serverIdentify(self, msg: bytes) -> None:
|
||||
incommingJson = json.loads(msg.decode('UTF-8'))
|
||||
header = json.loads(b64decode(incommingJson['header']).decode('UTF-8'))
|
||||
self.clientAddr = header['source']
|
||||
self.currentUser = header['username']
|
||||
self.currentClientPublicKey = self.clientPublicKey[self.currentUser]
|
||||
try:
|
||||
if not self.verifyRSAHeaderSignature(b64decode(incommingJson['header']),
|
||||
b64decode(incommingJson['headersignature'])) or header[
|
||||
@ -59,9 +62,6 @@ class NetWrapper:
|
||||
raise Exception('Bad initial message')
|
||||
except Exception:
|
||||
raise Exception('Bad initial message')
|
||||
self.clientAddr = header['source']
|
||||
self.currentUser = header['username']
|
||||
self.currentClientPublicKey = self.clientPublicKey[self.currentUser]
|
||||
retheader, retheadersignature = self.signRSAHeader("IDY", {})
|
||||
retmsg = self.ecryptRSAMessage(b64decode(incommingJson['message']).decode('UTF-8'))
|
||||
identMsg = json.dumps(
|
||||
|
Loading…
Reference in New Issue
Block a user