mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] use real random for hash selection
This commit is contained in:
parent
c14acc0fae
commit
8c6db3845d
1 changed files with 1 additions and 1 deletions
|
@ -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.digits
|
||||
salt = ''.join(random.sample(char_set, 8))
|
||||
salt = ''.join([random.SystemRandom().choice(char_set) for x in range(8)])
|
||||
salt = '$1$' + salt + '$'
|
||||
user_pwd = '{CRYPT}' + crypt.crypt(str(password), salt)
|
||||
attr_dict = {
|
||||
|
|
Loading…
Add table
Reference in a new issue