# did we reach the minimum amount of intermediate different passwords?
ifreuse_distance>=min_diff_passwords_required:
returnTrue
# be sure to re-use the same salt
# be sure to re-use the same salt
# NOTE, how the salt is serialized in the password field is dependent on the algorithm
# NOTE, how the salt is serialized in the password field is dependent on the algorithm
...
@@ -483,12 +480,13 @@ class PasswordHistory(models.Model):
...
@@ -483,12 +480,13 @@ class PasswordHistory(models.Model):
else:
else:
# This means we got something unexpected. We don't want to throw an exception, but
# This means we got something unexpected. We don't want to throw an exception, but
# log as an error and basically allow any password reuse
# log as an error and basically allow any password reuse
AUDIT_LOG.error('Unknown password hashing algorithm "{0}" found in existing password hash, password reuse policy will not be enforced!!!'.format(algorithm))
AUDIT_LOG.error('''
Unknown password hashing algorithm "{0}" found in existing password
hash, password reuse policy will not be enforced!!!