This commit is contained in:
@ -24,7 +24,7 @@ def loadPublicKey() -> RsaKey:
|
||||
except ValueError:
|
||||
print('Invalid server public key!')
|
||||
sys.exit(1)
|
||||
return RSA.import_key(key)
|
||||
return rsaKey
|
||||
|
||||
|
||||
def loadPrivateKey(passphrase: str) -> RsaKey:
|
||||
@ -88,7 +88,6 @@ SERVER_PUBLIC_KEY = loadPublicKey()
|
||||
CLIENT_PRIVATE_KEY = loadPrivateKey(PASSPHRASE)
|
||||
CLIENT_ADDRESS = loadAddress()
|
||||
|
||||
|
||||
while True:
|
||||
command = input("Type a command:")
|
||||
separatedCommand = command.split(" ")
|
||||
@ -102,6 +101,7 @@ while True:
|
||||
network = NetWrapper(CLIENT_PRIVATE_KEY, CLIENT_ADDRESS, separatedCommand[1], SERVER_PUBLIC_KEY)
|
||||
if not network.identifyServer():
|
||||
print('Server identification failed!')
|
||||
continue
|
||||
|
||||
network.createEncryptedChannel()
|
||||
network.authenticate(password=separatedCommand[2])
|
||||
@ -155,5 +155,5 @@ while True:
|
||||
|
||||
printCommand()
|
||||
|
||||
except Exception:
|
||||
print('Error: '+Exception.args)
|
||||
except Exception as e:
|
||||
print('Error: '+str(e))
|
Reference in New Issue
Block a user