This commit is contained in:
@@ -18,7 +18,7 @@ class NetWrapper:
|
||||
self.currentClientPublicKey = "".encode('UTF-8')
|
||||
self.serverPrivateKey = serverPrivateKey
|
||||
self.cipherkey = "".encode('UTF-8')
|
||||
self.network = network_interface('./', 'A')
|
||||
self.network = network_interface('./../../netsim/network/', 'A')
|
||||
self.clientAddr = ""
|
||||
self.currentUser = ""
|
||||
self.authenticationInstance = authenticationInstance
|
||||
@@ -64,6 +64,7 @@ class NetWrapper:
|
||||
serverpubkey = int(cipher_rsa.decrypt(b64decode(decodedmsg['message'])).decode('UTF-8'))
|
||||
self.cipherkey = dh.gen_shared_key(serverpubkey).encode('UTF-8')
|
||||
|
||||
|
||||
def login(self) -> bool:
|
||||
b64 = {'source': '', 'type': ''}
|
||||
while not (b64['source'] == self.clientAddr and b64['type'] == 'AUT'):
|
||||
@@ -95,10 +96,15 @@ class NetWrapper:
|
||||
print("Incorrect decryption")
|
||||
|
||||
def initClientConnection(self, msg: bytes) -> bytes:
|
||||
print('3')
|
||||
try:
|
||||
print('4')
|
||||
self.serverIdentify(msg)
|
||||
print('5')
|
||||
self.keyExchange()
|
||||
print('6')
|
||||
success = self.login()
|
||||
print('7')
|
||||
if success:
|
||||
return "LINOK".encode('UTF-8')
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user