From f8161f34fa83f178643e5c16632e8df5ac9b6d03 Mon Sep 17 00:00:00 2001 From: "DESKTOP-DPA61F8\\Benedek" Date: Sun, 25 Apr 2021 17:45:22 +0200 Subject: [PATCH 1/2] no message --- server/authentication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/authentication.py b/server/authentication.py index ea2f435..dbc5e17 100644 --- a/server/authentication.py +++ b/server/authentication.py @@ -135,14 +135,14 @@ class Authetication: return dictionary - def loadServerPrivateKey(self) -> RsaKey: + def loadServerPrivateKey(self, passphrase: str) -> RsaKey: with open(self.CONFIG_FILE_LOCATION) as json_file: data = json.load(json_file) key = data['serverPrivateKey'] key = bytes.fromhex(key) try: - rsaKey = RSA.import_key(key) + rsaKey = RSA.import_key(key, passphrase) except ValueError: print('Invalid server private key!') return rsaKey From 76281563400f7c5930a5b1f19fc415c40925ec86 Mon Sep 17 00:00:00 2001 From: Attila Szigeti Date: Sun, 25 Apr 2021 17:50:39 +0200 Subject: [PATCH 2/2] server execute --- server/server.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/server/server.py b/server/server.py index b45e878..9b0c16f 100644 --- a/server/server.py +++ b/server/server.py @@ -107,4 +107,14 @@ class Server: def startServer(self): while True: message = self.networkInstance.recieveMessage().decode('UTF-8') - self.parseCommand(message) + command = self.parseCommand(message) + #ha LINOK vagy LINERROR donothing + if command == "LINERROR" or command == "LINOK" or command == "ERROR": + print("not right commands") + elif len(command) == 1: + execute_message = self.execute(self,command, "", "") + elif len(command) == 2: + execute_message = self.execute(self, command, command[1], "") + elif len(command) == 3: + execute_message = self.execute(self, command, command[1], command[2]) + self.networkInstance.sendMessage(self, execute_message)