Long key
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-04-25 19:15:08 +02:00
parent c5d4859326
commit 45bab9c9f3
5 changed files with 12 additions and 4 deletions

View File

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