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