From 78196f209cf9d6035729be43fa28f00d18c4212c Mon Sep 17 00:00:00 2001 From: EndMove Date: Sat, 26 Feb 2022 18:26:12 +0100 Subject: [PATCH 1/6] Update Python client (fix bugs) --- controller/AppController.py | 3 ++- net/UnicastConnection.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/controller/AppController.py b/controller/AppController.py index 7b3376a..21acc5e 100644 --- a/controller/AppController.py +++ b/controller/AppController.py @@ -31,9 +31,10 @@ class AppController: if message_id == Protocol.PARSE_SIGNOK: self.window_controller.switch_connected_mode() self.show_message("Connection done", False) + self.on_filelist() elif message_id == Protocol.PARSE_SIGNERROR: self.show_message("Error during SIGN_IN / SIGN_UP", True) - self.on_filelist() + self.connection.close() except Exception as ex: print(ex) traceback.print_exc() diff --git a/net/UnicastConnection.py b/net/UnicastConnection.py index a11ea9a..e854269 100644 --- a/net/UnicastConnection.py +++ b/net/UnicastConnection.py @@ -107,5 +107,11 @@ class UnicastConnection: def close(self): self.sock.close() + self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.is_connected = False + self.is_tls = False + self.ssock = None + self.ca_path = None + self.ssl_info = None From ba002a4392b303b6adbd72bc3e16d2313412b1ae Mon Sep 17 00:00:00 2001 From: EndMove Date: Sat, 5 Mar 2022 15:05:52 +0100 Subject: [PATCH 2/6] Add default login value --- gui/MainWindow.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gui/MainWindow.py b/gui/MainWindow.py index 16dfef2..e73ae59 100644 --- a/gui/MainWindow.py +++ b/gui/MainWindow.py @@ -11,10 +11,14 @@ class MainWindow: self.root.title("SecCon - © Louis SWINNEN 2022") self.root.config(bd=5) self.host = tk.StringVar() + self.host.set("127.0.0.1") self.passw = tk.StringVar() + self.passw.set("aaaaa") self.login = tk.StringVar() + self.login.set("aa") self.tls = tk.BooleanVar() self.port = tk.IntVar() + self.port.set(8500) self.draw_window() def start_main_loop(self): From 63772e7d11f1ebc8faf7fef6e98077396642cd4c Mon Sep 17 00:00:00 2001 From: Maximilien LEDOUX Date: Tue, 8 Mar 2022 16:30:16 +0100 Subject: [PATCH 3/6] =?UTF-8?q?TLS=20:=20Ajout=20fichier=20cl=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/AppController.py | 9 +++++---- ffe.labo.swilabus.com.p12 | Bin 0 -> 4469 bytes 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 ffe.labo.swilabus.com.p12 diff --git a/controller/AppController.py b/controller/AppController.py index 7b3376a..fcd96ee 100644 --- a/controller/AppController.py +++ b/controller/AppController.py @@ -3,6 +3,7 @@ from model.Protocol import * import traceback import os.path + class AppController: def __init__(self, parser): self.parser = parser @@ -19,8 +20,8 @@ class AppController: print("[AppController::on_sign]") try: if not self.connection.is_connected: - print("[AppController::on_sign] connecting ... calling UnicastConnection::connect") - self.connect(host, port, tls) + print("[AppController::on_sign] connecting ... calling UnicastConnection::connect") + self.connect(host, port, tls) if not register: message = self.parser.build_SIGNIN(login, passw) else: @@ -41,7 +42,7 @@ class AppController: def get_filename_size_from_item(self, item): tokens = item.split('!') if len(tokens) == 2: - return (tokens[0],tokens[1]) + return (tokens[0], tokens[1]) else: return None @@ -117,7 +118,7 @@ class AppController: elif message_id == Protocol.PARSE_REMOVEFILEERROR: self.show_message("Error while erasing file.", True) - def show_message(self,message, is_error): + def show_message(self, message, is_error): self.window_controller.show_message(message, is_error) def connect(self, host, port, tls): diff --git a/ffe.labo.swilabus.com.p12 b/ffe.labo.swilabus.com.p12 new file mode 100644 index 0000000000000000000000000000000000000000..98ca601f97c230174c70b91ba7f73a9920b34370 GIT binary patch literal 4469 zcmV-*5sL0Gf)Q~70Ru3C5jO@2Duzgg_YDCD0ic2rCD7=>kX(ZP8a$LvTy)e5xzIuq(@ zsN%kP(HtMzFVox|F!8jkf^wRN_%E9z-6}b~kdrG=a35oG@MNROvLJ<^eK*vMG?^bT@K=yX-hQhxYgh04-mKXD&#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C3=B4te=20par=20d?= =?UTF-8?q?=C3=A9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ffe.labo.swilabus.com.p12 | Bin 4469 -> 0 bytes gui/MainWindow.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 ffe.labo.swilabus.com.p12 diff --git a/ffe.labo.swilabus.com.p12 b/ffe.labo.swilabus.com.p12 deleted file mode 100644 index 98ca601f97c230174c70b91ba7f73a9920b34370..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4469 zcmV-*5sL0Gf)Q~70Ru3C5jO@2Duzgg_YDCD0ic2rCD7=>kX(ZP8a$LvTy)e5xzIuq(@ zsN%kP(HtMzFVox|F!8jkf^wRN_%E9z-6}b~kdrG=a35oG@MNROvLJ<^eK*vMG?^bT@K=yX-hQhxYgh04-mKXD&#;dK zVDm4-s}|{sQ5A=nja{*wWz6v3^LCR+p&krzm6^P_;|0- zBAHPKF`E7WAm(PABpX9fOa3D`%W+|?N5}0$dt38p-*p}iBxVo&Mhw<%<|Z47nRzqE zHqV`pXfss~?UDB+xZ!srdD4mI6jufR`8v-n8@`N3<`Exjbrea6Dh*#A(zcvhhOLO1 z85uf5%=>PtN%IxgB1FJ(%AVrJg94um(uJrsoMkyCue627|Fs_)^eQ-BQF(M>*RoNM z=+{l~wy4^}e9XKGBw-^{b2=jjc22z3N_WYID7%<^HtgLCf2m|=N;4|tz@k?hyCSr;$LVTjty`}^&=UoWIKrL9?lP*KxN^lPo_aG96v5vn zOBxh~$S6g2a|!;e+5k?<_>*cf2}Fxay!1DVo2t!_AK2uC*%~kSF>`GGwOB@}G5&WP z#oIN3KDFC88;k)-?rc!XNUQ+W_7exk^N}yg4>o#PHNKOwjVt&O9US#NW^lH;uv?mi zt@kh|bR6=qTM32B<3s(SW@$^nbnz1GezD?{5ezzOaeCY)ZEHtx+2+k55Y@UzWdd6| zdP^<_9!hd93T=MlJ4^m=Hm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pQQQd^xwkcr4-YLg~pdmv6@_GB*uWdITnHX>N@Xf)W+&Qq@< z#~zqozLd1t`k?_VZw5lzSKFi&3`*yYN`fx(IfHDu$5WCqi2|H-%O2oaleN3gSr5z@ zpFbGj)?r!#3)|XvCyRD9{s|0h9=tbbm<+LN6F%7%h+FYb2Y!^@kOcA>|&yAoECk5UXg$Y zLqQbPxv>?1YFUe#Uzd76z9umxFe3&DDuzgg_YDCF6)_eB6g#(*6x5oXTPaX6KTVKb zQbYD}X)rM`AutIB1uG5%0vZJX1Qh?Y-uexmpl&aJEs-pVPn0n?*rWsqL;+=(%A#p5 H0s;sCd`WKS diff --git a/gui/MainWindow.py b/gui/MainWindow.py index e73ae59..4200ab9 100644 --- a/gui/MainWindow.py +++ b/gui/MainWindow.py @@ -11,14 +11,14 @@ class MainWindow: self.root.title("SecCon - © Louis SWINNEN 2022") self.root.config(bd=5) self.host = tk.StringVar() - self.host.set("127.0.0.1") + self.host.set("ffe.labo.swilabus.com") self.passw = tk.StringVar() self.passw.set("aaaaa") self.login = tk.StringVar() self.login.set("aa") self.tls = tk.BooleanVar() self.port = tk.IntVar() - self.port.set(8500) + self.port.set(8000) self.draw_window() def start_main_loop(self): From c44aa83c642e2411cc426281801505b6bcda008d Mon Sep 17 00:00:00 2001 From: EndMove Date: Thu, 10 Mar 2022 14:43:35 +0100 Subject: [PATCH 5/6] Default TLS//SSL enabled --- gui/MainWindow.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/MainWindow.py b/gui/MainWindow.py index 4200ab9..b5ccf23 100644 --- a/gui/MainWindow.py +++ b/gui/MainWindow.py @@ -17,6 +17,7 @@ class MainWindow: self.login = tk.StringVar() self.login.set("aa") self.tls = tk.BooleanVar() + self.tls.set(True) self.port = tk.IntVar() self.port.set(8000) self.draw_window() From d0e4fdbf6ca5692c801026d72258805b183c0f04 Mon Sep 17 00:00:00 2001 From: EndMove Date: Tue, 15 Mar 2022 09:56:35 +0100 Subject: [PATCH 6/6] Update with the good username --- gui/MainWindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/MainWindow.py b/gui/MainWindow.py index b5ccf23..13b66de 100644 --- a/gui/MainWindow.py +++ b/gui/MainWindow.py @@ -15,7 +15,7 @@ class MainWindow: self.passw = tk.StringVar() self.passw.set("aaaaa") self.login = tk.StringVar() - self.login.set("aa") + self.login.set("aaaaa") self.tls = tk.BooleanVar() self.tls.set(True) self.port = tk.IntVar()