diff --git a/test/case/ietf_system/add_delete_user.py b/test/case/ietf_system/add_delete_user.py index 948c8da3..e4282323 100755 --- a/test/case/ietf_system/add_delete_user.py +++ b/test/case/ietf_system/add_delete_user.py @@ -2,11 +2,12 @@ import infamy import copy -import crypt +from passlib.hash import sha256_crypt import random import string import re + def generate_restrictred_credential(): credential = "".join(random.choices(string.ascii_lowercase, k=64)) @@ -15,6 +16,7 @@ def generate_restrictred_credential(): return credential + with infamy.Test() as test: with test.step("Initialize"): env = infamy.Env(infamy.std_topology("1x1")) @@ -23,8 +25,7 @@ with infamy.Test() as test: with test.step("Add new user"): username = generate_restrictred_credential() password = generate_restrictred_credential() - salt = crypt.mksalt(crypt.METHOD_SHA256) - hashed_password = crypt.crypt(password, salt) + hashed_password = sha256_crypt.using(rounds=5000).hash(password) print(f"username: {username}") print(f"password: {password}") print(f"hashed_password: {hashed_password}")