Browse Source

move to salted sha512 due security reason and bug in ldap3 sha handling

master
Andrea Cimbalo 7 years ago
parent
commit
5aff41ff22
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      lilikusers.py

+ 2
- 3
lilikusers.py View File

@ -67,9 +67,8 @@ class LILiK_USER(object):
diff = utils.DictDiffer(new_lilik_user, self.__dict__)
modifiers = {user_cn: {}}
if 'userPassword' in diff.added() and new_lilik_user['userPassword']:
action = ldap3.MODIFY_REPLACE
hashed = ldap3.utils.hashed(ldap3.HASHED_SALTED_SHA, new_lilik_user['userPassword'])
modifiers[user_cn]['userPassword'] = [(action, [hashed])]
hashed = ldap3.utils.hashed.hashed(ldap3.HASHED_SALTED_SHA512, new_lilik_user['userPassword'])
modifiers[user_cn]['userPassword'] = [(ldap3.MODIFY_REPLACE, [hashed])]
for changed in diff.changed():
if changed == 'services':
services_diff = utils.DictDiffer(self.__dict__[changed], new_lilik_user[changed])


Loading…
Cancel
Save