From 6c9156c3aee483facebd5473cbb8fada3149f2da Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 14 Aug 2017 16:49:50 +0200 Subject: [PATCH] [enh] according to https://www.safaribooksonline.com/library/view/practical-unix-and/0596003234/ch04s03.html we can go up to 16 salt caracters --- src/yunohost/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yunohost/user.py b/src/yunohost/user.py index 97466f7f2..51b7400de 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -137,7 +137,7 @@ def user_create(auth, username, firstname, lastname, mail, password, # Adapt values for LDAP fullname = '%s %s' % (firstname, lastname) char_set = string.ascii_uppercase + string.ascii_lowercase + string.digits + "./" - salt = ''.join([random.SystemRandom().choice(char_set) for x in range(12)]) + salt = ''.join([random.SystemRandom().choice(char_set) for x in range(16)]) salt = '$6$' + salt + '$' user_pwd = '{CRYPT}' + crypt.crypt(str(password), salt) attr_dict = {