diff --git a/flaschengeist/modules/auth_ldap/__init__.py b/flaschengeist/modules/auth_ldap/__init__.py index 17fbe84..ddc0fb1 100644 --- a/flaschengeist/modules/auth_ldap/__init__.py +++ b/flaschengeist/modules/auth_ldap/__init__.py @@ -1,6 +1,6 @@ import ssl from ldap3.utils.hashed import hashed -from ldap3 import SUBTREE, MODIFY_REPLACE, HASHED_SALTED_SHA512 +from ldap3 import SUBTREE, MODIFY_REPLACE, HASHED_SALTED_SHA512, HASHED_SALTED_MD5 from ldap3.core.exceptions import LDAPPasswordIsMandatoryError, LDAPBindError from flask import current_app as app from flask_ldapconn import LDAPConn @@ -99,7 +99,8 @@ class AuthLDAP(AuthPlugin): if hasattr(user, name): modifier[ldap_name] = [(MODIFY_REPLACE, [getattr(user, name)])] if new_password: - salted_password = hashed(HASHED_SALTED_SHA512, new_password) + # TODO: Use secure hash! + salted_password = hashed(HASHED_SALTED_MD5, new_password) modifier["userPassword"] = [(MODIFY_REPLACE, [salted_password])] ldap_conn.modify(dn, modifier) except (LDAPPasswordIsMandatoryError, LDAPBindError):