mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
18.26.2015 ca669ae54f86dbeea277280690584d9f591c7571
opendj-server-legacy/src/main/java/org/opends/server/extensions/DictionaryPasswordValidator.java
@@ -132,14 +132,12 @@
    // the password which is the default behaviour ('check-substrings: false')
    int minSubstringLength = password.length();
    if (config.isCheckSubstrings())
    if (config.isCheckSubstrings()
        // We apply the minimal substring length only if the provided value
        // is smaller then the actual password length
        && config.getMinSubstringLength() < password.length())
    {
      // We apply the minimal substring length only if the provided value
      // is smaller then the actual password length
      if (config.getMinSubstringLength() < password.length())
      {
        minSubstringLength = config.getMinSubstringLength();
      }
      minSubstringLength = config.getMinSubstringLength();
    }
    // Verify if the dictionary contains the word(s) in the password
@@ -152,15 +150,12 @@
    // If the reverse password checking is enabled, then verify if the
    // reverse value of the password is in the dictionary.
    if (config.isTestReversedPassword())
    if (config.isTestReversedPassword()
        && isDictionaryBased(
            new StringBuilder(password).reverse().toString(), minSubstringLength))
    {
      if (isDictionaryBased(
        new StringBuilder(password).reverse().toString(), minSubstringLength))
      {
        invalidReason.append(
          ERR_DICTIONARY_VALIDATOR_PASSWORD_IN_DICTIONARY.get());
        return false;
      }
      invalidReason.append(ERR_DICTIONARY_VALIDATOR_PASSWORD_IN_DICTIONARY.get());
      return false;
    }