diff --git a/client/netwrapper.py b/client/netwrapper.py index 4e19384..4802faf 100644 --- a/client/netwrapper.py +++ b/client/netwrapper.py @@ -13,7 +13,7 @@ from netsim import network_interface class NetWrapper: - def __init__(self, privateKey: RsaKey, clientAddress: str, username: str, serverPubKey: RsaKey, + def __init__(self, privateKey: RsaKey, clientAddress: str, serverPubKey: RsaKey, username: str = "", serverAddr: str = 'A'): self.network = network_interface('./../../netsim/network/', clientAddress) self.serverAddr = serverAddr @@ -105,6 +105,10 @@ class NetWrapper: print("Authentication error") def connectToServer(self, password: str) -> None: + if self.username == "": + raise Exception('Username is not initialized') + if password == "": + raise Exception('Passowrd may not be empty') identStatus = self.identifyServer() if not identStatus: raise Exception('Server identification faliure')