From 3dbde8fbb83535bb5749f7e712c1f3f757a9f59c Mon Sep 17 00:00:00 2001 From: "DESKTOP-DPA61F8\\Benedek" Date: Sun, 25 Apr 2021 16:06:56 +0200 Subject: [PATCH] Authentication_test corrections --- server/authentication_test.py | 7 +++++-- server/config_init.py | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/server/authentication_test.py b/server/authentication_test.py index 47d37be..1f5a161 100644 --- a/server/authentication_test.py +++ b/server/authentication_test.py @@ -68,10 +68,13 @@ def testPersistency(): logging.info('PERSISTENCY TEST') auth = Authetication() auth.initConfig() + serverPublicKey = init.generatePrivateKeyForServer(auth, 'admin') auth.saveUser('alma','alma') - init.generatePrivateKeyForUser(auth, 'alma', 'amla') + homeDir = auth.login('alma','alma') + init.generatePrivateKeyForUser(auth, 'alma', 'amla', serverPublicKey, init.generateSourceAddress(homeDir)) auth.saveUser('citrom','citrom') - init.generatePrivateKeyForUser(auth, 'citrom', 'mortic') + homeDir = auth.login('citrom','citrom') + init.generatePrivateKeyForUser(auth, 'citrom', 'mortic', serverPublicKey, init.generateSourceAddress(homeDir)) auth2 = Authetication() if auth2.checkUserExists('alma'): diff --git a/server/config_init.py b/server/config_init.py index 411912c..f2f9250 100644 --- a/server/config_init.py +++ b/server/config_init.py @@ -5,7 +5,6 @@ from Crypto.PublicKey import RSA from authentication import Authetication - def generatePrivateKeyForUser(auth: Authetication,username: str, user_passphrase: str, public_server_key: str,address: str) -> bool: if auth.checkUserExists(username): with open(auth.CONFIG_FILE_LOCATION) as json_file: