Compare commits

...

2 Commits

Author SHA1 Message Date
48fd34117d
Merge branch 'master' of https://git.kmlabz.com/BiztProtoBois/client into master
All checks were successful
continuous-integration/drone/push Build is passing
2021-04-26 23:27:32 +02:00
d66cd15ec9
init 2021-04-26 23:27:17 +02:00

View File

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