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

Jean-Noel Rouvignac
19.30.2014 377b2709c64b32fe93905b466482216c2cc0581c
opendj3-server-dev/src/server/org/opends/server/plugins/PasswordPolicyImportPlugin.java
@@ -344,11 +344,11 @@
policyLoop:
      for (Attribute a : attrList)
      {
        for (AttributeValue v : a)
        for (ByteString v : a)
        {
          try
          {
            policyDN = DN.decode(v.getValue());
            policyDN = DN.decode(v);
            AuthenticationPolicy authPolicy = DirectoryServer
                .getAuthenticationPolicy(policyDN);
            if (authPolicy == null)
@@ -386,10 +386,8 @@
            AttributeBuilder builder = new AttributeBuilder(a, true);
            boolean gotError = false;
            for (AttributeValue v : a)
            for (ByteString value : a)
            {
              ByteString value = v.getValue();
              if (policy.isAuthPasswordSyntax())
              {
                if (!AuthPasswordSyntax.isEncoded(value))
@@ -398,9 +396,7 @@
                  {
                    for (PasswordStorageScheme<?> s : schemes)
                    {
                      ByteString nv = s.encodeAuthPassword(value);
                      builder.add(AttributeValues.create(policy
                          .getPasswordAttribute(), nv));
                      builder.add(s.encodeAuthPassword(value));
                    }
                  }
                  catch (Exception e)
@@ -416,7 +412,7 @@
                }
                else
                {
                  builder.add(v);
                  builder.add(value);
                }
              }
              else
@@ -427,9 +423,7 @@
                  {
                    for (PasswordStorageScheme<?> s : schemes)
                    {
                      ByteString nv = s.encodePasswordWithScheme(value);
                      builder.add(AttributeValues.create(policy
                          .getPasswordAttribute(), nv));
                      builder.add(s.encodePasswordWithScheme(value));
                    }
                  }
                  catch (Exception e)
@@ -445,7 +439,7 @@
                }
                else
                {
                  builder.add(v);
                  builder.add(value);
                }
              }
            }
@@ -478,17 +472,15 @@
        AttributeBuilder builder = new AttributeBuilder(a, true);
        boolean gotError = false;
        for (AttributeValue v : a)
        for (ByteString value : a)
        {
          ByteString value = v.getValue();
          if (!AuthPasswordSyntax.isEncoded(value))
          {
            try
            {
              for (PasswordStorageScheme<?> s : defaultAuthPasswordSchemes)
              {
                ByteString nv = s.encodeAuthPassword(value);
                builder.add(AttributeValues.create(t, nv));
                builder.add(s.encodeAuthPassword(value));
              }
            }
            catch (Exception e)
@@ -502,7 +494,7 @@
          }
          else
          {
            builder.add(v);
            builder.add(value);
          }
        }
@@ -530,17 +522,15 @@
        AttributeBuilder builder = new AttributeBuilder(a, true);
        boolean gotError = false;
        for (AttributeValue v : a)
        for (ByteString value : a)
        {
          ByteString value = v.getValue();
          if (!UserPasswordSyntax.isEncoded(value))
          {
            try
            {
              for (PasswordStorageScheme<?> s : defaultUserPasswordSchemes)
              {
                ByteString nv = s.encodePasswordWithScheme(value);
                builder.add(AttributeValues.create(t, nv));
                builder.add(s.encodePasswordWithScheme(value));
              }
            }
            catch (Exception e)
@@ -554,7 +544,7 @@
          }
          else
          {
            builder.add(v);
            builder.add(value);
          }
        }