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

This commit is contained in:
2021-04-25 16:38:57 +02:00
parent c61994a3cf
commit 10c481bc72
2 changed files with 14 additions and 10 deletions

View File

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