directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r535683 - in /directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store: ./ operations/
Date Sun, 06 May 2007 23:44:14 GMT
Author: erodriguez
Date: Sun May  6 16:44:13 2007
New Revision: 535683

URL: http://svn.apache.org/viewvc?view=rev&rev=535683
Log:
Updated backend store to support writing of plaintext password to DIT.

Modified:
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/JndiPrincipalStoreImpl.java
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/MultiBaseSearch.java
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/JndiPrincipalStoreImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/JndiPrincipalStoreImpl.java?view=diff&rev=535683&r1=535682&r2=535683
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/JndiPrincipalStoreImpl.java
(original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/JndiPrincipalStoreImpl.java
Sun May  6 16:44:13 2007
@@ -80,9 +80,9 @@
     }
 
 
-    public String changePassword( KerberosPrincipal principal, KerberosKey newKey ) throws
Exception
+    public String changePassword( KerberosPrincipal principal, String newPassword ) throws
Exception
     {
-        return store.changePassword( principal, newKey );
+        return store.changePassword( principal, newPassword );
     }
 
 

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/MultiBaseSearch.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/MultiBaseSearch.java?view=diff&rev=535683&r1=535682&r2=535683
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/MultiBaseSearch.java
(original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/MultiBaseSearch.java
Sun May  6 16:44:13 2007
@@ -148,14 +148,14 @@
     }
 
 
-    public String changePassword( KerberosPrincipal principal, KerberosKey newKey ) throws
Exception
+    public String changePassword( KerberosPrincipal principal, String newPassword ) throws
Exception
     {
         env.put( Context.PROVIDER_URL, catalog.getBaseDn( principal.getRealm() ) );
 
         try
         {
             DirContext ctx = ( DirContext ) factory.getInitialContext( env );
-            return ( String ) execute( ctx, new ChangePassword( principal, newKey ) );
+            return ( String ) execute( ctx, new ChangePassword( principal, newPassword )
);
         }
         catch ( NamingException ne )
         {

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java?view=diff&rev=535683&r1=535682&r2=535683
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java
(original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java
Sun May  6 16:44:13 2007
@@ -20,7 +20,6 @@
 package org.apache.directory.server.kerberos.shared.store;
 
 
-import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 
@@ -35,7 +34,7 @@
     public String addPrincipal( PrincipalStoreEntry entry ) throws Exception;
 
 
-    public String changePassword( KerberosPrincipal principal, KerberosKey newKey ) throws
Exception;
+    public String changePassword( KerberosPrincipal principal, String newPassword ) throws
Exception;
 
 
     public String deletePrincipal( KerberosPrincipal principal ) throws Exception;

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java?view=diff&rev=535683&r1=535682&r2=535683
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
(original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
Sun May  6 16:44:13 2007
@@ -94,9 +94,9 @@
     }
 
 
-    public String changePassword( KerberosPrincipal principal, KerberosKey newKey ) throws
Exception
+    public String changePassword( KerberosPrincipal principal, String newPassword ) throws
Exception
     {
-        return ( String ) execute( new ChangePassword( principal, newKey ) );
+        return ( String ) execute( new ChangePassword( principal, newPassword ) );
     }
 
 

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java?view=diff&rev=535683&r1=535682&r2=535683
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
(original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
Sun May  6 16:44:13 2007
@@ -30,7 +30,6 @@
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchResult;
-import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.kerberos.shared.store.KerberosAttribute;
@@ -52,17 +51,17 @@
 
     /** The Kerberos principal who's password is to be changed. */
     protected KerberosPrincipal principal;
-    /** The new key for the update. */
-    protected KerberosKey newKey;
+    /** The new password for the update. */
+    protected String newPassword;
 
 
     /**
      * Creates the action to be used against the embedded ApacheDS DIT.
      */
-    public ChangePassword(KerberosPrincipal principal, KerberosKey newKey)
+    public ChangePassword( KerberosPrincipal principal, String newPassword )
     {
         this.principal = principal;
-        this.newKey = newKey;
+        this.newPassword = newPassword;
     }
 
 
@@ -73,9 +72,11 @@
             return null;
         }
 
-        ModificationItemImpl[] mods = new ModificationItemImpl[1];
-        Attribute newKeyAttribute = new AttributeImpl( "krb5key", newKey.getEncoded() );
-        mods[0] = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, newKeyAttribute
);
+        ModificationItemImpl[] mods = new ModificationItemImpl[2];
+        Attribute newPasswordAttribute = new AttributeImpl( "userPassword", newPassword );
+        mods[0] = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, newPasswordAttribute
);
+        Attribute principalAttribute = new AttributeImpl( "krb5PrincipalName", principal.getName()
);
+        mods[1] = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, principalAttribute
);
 
         String dn = null;
 



Mime
View raw message