| | |
| | | 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) |
| | |
| | | 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)) |
| | |
| | | { |
| | | for (PasswordStorageScheme<?> s : schemes) |
| | | { |
| | | ByteString nv = s.encodeAuthPassword(value); |
| | | builder.add(AttributeValues.create(policy |
| | | .getPasswordAttribute(), nv)); |
| | | builder.add(s.encodeAuthPassword(value)); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | } |
| | | else |
| | | { |
| | | builder.add(v); |
| | | builder.add(value); |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | for (PasswordStorageScheme<?> s : schemes) |
| | | { |
| | | ByteString nv = s.encodePasswordWithScheme(value); |
| | | builder.add(AttributeValues.create(policy |
| | | .getPasswordAttribute(), nv)); |
| | | builder.add(s.encodePasswordWithScheme(value)); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | } |
| | | else |
| | | { |
| | | builder.add(v); |
| | | builder.add(value); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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) |
| | |
| | | } |
| | | else |
| | | { |
| | | builder.add(v); |
| | | builder.add(value); |
| | | } |
| | | } |
| | | |
| | |
| | | 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) |
| | |
| | | } |
| | | else |
| | | { |
| | | builder.add(v); |
| | | builder.add(value); |
| | | } |
| | | } |
| | | |