directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1041856 - in /directory/apacheds/branches/apacheds-kerberos-codec-2.0: kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/ kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operati...
Date Fri, 03 Dec 2010 15:10:55 GMT
Author: elecharny
Date: Fri Dec  3 15:10:54 2010
New Revision: 1041856

URL: http://svn.apache.org/viewvc?rev=1041856&view=rev
Log:
Using KerberosPrincipal to access data from the backend instead of PrincipalName

Modified:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/DirectoryPrincipalStore.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/MultiBaseSearch.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/MapPrincipalStoreImpl.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/MapPrincipalStoreImpl.java

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/DirectoryPrincipalStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/DirectoryPrincipalStore.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/DirectoryPrincipalStore.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/DirectoryPrincipalStore.java
Fri Dec  3 15:10:54 2010
@@ -20,8 +20,9 @@
 package org.apache.directory.server.kerberos.shared.store;
 
 
+import javax.security.auth.kerberos.KerberosPrincipal;
+
 import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.ldap.name.DN;
 
 
@@ -53,7 +54,7 @@ public class DirectoryPrincipalStore imp
     /**
      * {@inheritDoc}
      */
-    public String changePassword( PrincipalName principal, String newPassword ) throws Exception
+    public String changePassword( KerberosPrincipal principal, String newPassword ) throws
Exception
     {
         SingleBaseSearch singleBaseSearch = new SingleBaseSearch( directoryService, searchBaseDn
);
         return singleBaseSearch.changePassword( principal, newPassword );
@@ -63,7 +64,7 @@ public class DirectoryPrincipalStore imp
     /**
      * {@inheritDoc}
      */
-    public PrincipalStoreEntry getPrincipal( PrincipalName principal ) throws Exception
+    public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception
     {
         SingleBaseSearch singleBaseSearch = new SingleBaseSearch( directoryService, searchBaseDn
);
         return singleBaseSearch.getPrincipal( principal );

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/MultiBaseSearch.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/MultiBaseSearch.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/MultiBaseSearch.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/MultiBaseSearch.java
Fri Dec  3 15:10:54 2010
@@ -24,6 +24,7 @@ package org.apache.directory.server.kerb
 import java.util.Map;
 
 import javax.naming.NamingException;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DirectoryService;
@@ -34,7 +35,6 @@ import org.apache.directory.server.proto
 import org.apache.directory.server.protocol.shared.catalog.Catalog;
 import org.apache.directory.server.protocol.shared.catalog.GetCatalog;
 import org.apache.directory.server.protocol.shared.store.DirectoryServiceOperation;
-import org.apache.directory.shared.kerberos.components.PrincipalName;
 
 
 /**
@@ -67,7 +67,7 @@ class MultiBaseSearch implements Princip
     }
 
 
-    public PrincipalStoreEntry getPrincipal( PrincipalName principal ) throws Exception
+    public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception
     {
         try
         {
@@ -81,7 +81,7 @@ class MultiBaseSearch implements Princip
     }
 
 
-    public String changePassword( PrincipalName principal, String newPassword ) throws Exception
+    public String changePassword( KerberosPrincipal principal, String newPassword ) throws
Exception
     {
         try
         {

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java
Fri Dec  3 15:10:54 2010
@@ -21,7 +21,7 @@ package org.apache.directory.server.kerb
 
 
 
-import org.apache.directory.shared.kerberos.components.PrincipalName;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
 
 /**
@@ -40,7 +40,7 @@ public interface PrincipalStore
      * @return The name of the principal whose password is being changed.
      * @throws Exception
      */
-    public String changePassword( PrincipalName principal, String newPassword ) throws Exception;
+    public String changePassword( KerberosPrincipal principal, String newPassword ) throws
Exception;
 
 
     /**
@@ -50,5 +50,5 @@ public interface PrincipalStore
      * @return The {@link PrincipalStoreEntry} for the given Kerberos principal.
      * @throws Exception
      */
-    public PrincipalStoreEntry getPrincipal( PrincipalName principal ) throws Exception;
+    public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception;
 }

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
Fri Dec  3 15:10:54 2010
@@ -22,11 +22,12 @@ package org.apache.directory.server.kerb
 
 import java.util.Map;
 
+import javax.security.auth.kerberos.KerberosPrincipal;
+
 import org.apache.directory.server.kerberos.shared.messages.value.types.SamType;
 import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
-import org.apache.directory.shared.kerberos.components.PrincipalName;
 
 
 /**
@@ -37,7 +38,7 @@ public class PrincipalStoreEntry
     // principal
     private String distinguishedName;
     private String commonName;
-    private PrincipalName principal;
+    private KerberosPrincipal principal;
     private String realmName;
 
     // uidObject
@@ -60,7 +61,7 @@ public class PrincipalStoreEntry
     private Map<EncryptionType, EncryptionKey> keyMap;
 
 
-    PrincipalStoreEntry( String distinguishedName, String commonName, String userId, PrincipalName
principal,
+    PrincipalStoreEntry( String distinguishedName, String commonName, String userId, KerberosPrincipal
principal,
         int keyVersionNumber, KerberosTime validStart, KerberosTime validEnd, KerberosTime
passwordEnd, int maxLife,
         int maxRenew, int kdcFlags, Map<EncryptionType, EncryptionKey> keyMap, String
realmName, SamType samType,
         boolean disabled, boolean lockedOut, KerberosTime expiration )
@@ -222,7 +223,7 @@ public class PrincipalStoreEntry
      *
      * @return The principal.
      */
-    public PrincipalName getPrincipal()
+    public KerberosPrincipal getPrincipal()
     {
         return principal;
     }

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
Fri Dec  3 15:10:54 2010
@@ -24,13 +24,14 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.security.auth.kerberos.KerberosPrincipal;
+
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.kerberos.shared.io.decoder.EncryptionKeyDecoder;
 import org.apache.directory.server.kerberos.shared.messages.value.types.SamType;
 import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
-import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Value;
@@ -45,7 +46,7 @@ public class PrincipalStoreEntryModifier
     // principal
     private String distinguishedName;
     private String commonName;
-    private PrincipalName principal;
+    private KerberosPrincipal principal;
     private String realmName;
 
     // uidObject
@@ -220,7 +221,7 @@ public class PrincipalStoreEntryModifier
      *
      * @param principal
      */
-    public void setPrincipal( PrincipalName principal )
+    public void setPrincipal( KerberosPrincipal principal )
     {
         this.principal = principal;
     }

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
Fri Dec  3 15:10:54 2010
@@ -21,13 +21,14 @@ package org.apache.directory.server.kerb
 
 
 
+import javax.security.auth.kerberos.KerberosPrincipal;
+
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.kerberos.shared.store.operations.ChangePassword;
 import org.apache.directory.server.kerberos.shared.store.operations.GetPrincipal;
 import org.apache.directory.server.protocol.shared.ServiceConfigurationException;
-import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.ldap.name.DN;
 
 
@@ -58,13 +59,13 @@ class SingleBaseSearch implements Princi
     }
 
 
-    public PrincipalStoreEntry getPrincipal( PrincipalName principal ) throws Exception
+    public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception
     {
         return ( PrincipalStoreEntry ) new GetPrincipal( principal ).execute( session, searchBaseDn
);
     }
 
 
-    public String changePassword( PrincipalName principal, String newPassword ) throws Exception
+    public String changePassword( KerberosPrincipal principal, String newPassword ) throws
Exception
     {
         return (String) new ChangePassword( principal, newPassword ).execute( session, searchBaseDn
);
     }

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
Fri Dec  3 15:10:54 2010
@@ -23,10 +23,11 @@ package org.apache.directory.server.kerb
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.security.auth.kerberos.KerberosPrincipal;
+
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.kerberos.shared.store.KerberosAttribute;
 import org.apache.directory.server.protocol.shared.store.DirectoryServiceOperation;
-import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
 import org.apache.directory.shared.ldap.entry.DefaultModification;
@@ -49,7 +50,7 @@ public class ChangePassword implements D
     private static final long serialVersionUID = -7147685183641418353L;
 
     /** The Kerberos principal who's password is to be changed. */
-    protected PrincipalName principal;
+    protected KerberosPrincipal principal;
     /** The new password for the update. */
     protected String newPassword;
 
@@ -60,7 +61,7 @@ public class ChangePassword implements D
      * @param principal The principal to change the password for.
      * @param newPassword The password to change.
      */
-    public ChangePassword( PrincipalName principal, String newPassword )
+    public ChangePassword( KerberosPrincipal principal, String newPassword )
     {
         this.principal = principal;
         this.newPassword = newPassword;
@@ -83,12 +84,12 @@ public class ChangePassword implements D
         mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, newPasswordAttribute
) );
         
         EntryAttribute principalAttribute = new DefaultEntryAttribute( 
-            schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT
), principal.getNameString() );
+            schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT
), principal.getName() );
         mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, principalAttribute
) );
         
         //FIXME check if keyderivation is necessary
         
-        Entry entry = StoreUtils.findPrincipalEntry( session, searchBaseDn, principal.getNameString()
);
+        Entry entry = StoreUtils.findPrincipalEntry( session, searchBaseDn, principal.getName()
);
         session.modify( entry.getDn(), mods );
 
         return entry.getDn().toString();

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
Fri Dec  3 15:10:54 2010
@@ -24,6 +24,8 @@ import java.io.IOException;
 import java.text.ParseException;
 import java.util.Map;
 
+import javax.security.auth.kerberos.KerberosPrincipal;
+
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.kerberos.shared.messages.value.types.SamType;
@@ -35,7 +37,6 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
 import org.apache.directory.shared.kerberos.codec.types.PrincipalNameType;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
-import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.name.DN;
@@ -51,7 +52,7 @@ public class GetPrincipal implements Dir
     private static final long serialVersionUID = 4598007518413451945L;
 
     /** The name of the principal to get. */
-    private final PrincipalName principal;
+    private final KerberosPrincipal principal;
 
 
     /**
@@ -59,7 +60,7 @@ public class GetPrincipal implements Dir
      * 
      * @param principal The principal to search for in the directory.
      */
-    public GetPrincipal( PrincipalName principal )
+    public GetPrincipal( KerberosPrincipal principal )
     {
         this.principal = principal;
     }
@@ -76,7 +77,7 @@ public class GetPrincipal implements Dir
             return null;
         }
 
-        return getEntry( StoreUtils.findPrincipalEntry( session, base, principal.getNameString()
) );
+        return getEntry( StoreUtils.findPrincipalEntry( session, base, principal.getName()
) );
     }
 
 
@@ -95,7 +96,7 @@ public class GetPrincipal implements Dir
         modifier.setDistinguishedName( entry.getDn().getName() );
 
         String principal = entry.get( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ).getString();
-        modifier.setPrincipal( new PrincipalName( principal, PrincipalNameType.KRB_NT_PRINCIPAL
) );
+        modifier.setPrincipal( new KerberosPrincipal( principal, PrincipalNameType.KRB_NT_PRINCIPAL.getValue()
) );
 
         String keyVersionNumber = entry.get( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT
).getString();
         modifier.setKeyVersionNumber( Integer.parseInt( keyVersionNumber ) );

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/MapPrincipalStoreImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/MapPrincipalStoreImpl.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/MapPrincipalStoreImpl.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/MapPrincipalStoreImpl.java
Fri Dec  3 15:10:54 2010
@@ -31,7 +31,6 @@ import org.apache.directory.server.kerbe
 import org.apache.directory.server.kerberos.shared.store.PrincipalStoreEntryModifier;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
-import org.apache.directory.shared.kerberos.components.PrincipalName;
 
 
 /**
@@ -63,7 +62,7 @@ public class MapPrincipalStoreImpl imple
     }
 
 
-    public PrincipalStoreEntry getPrincipal( PrincipalName principal ) throws Exception
+    public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception
     {
         PrincipalStoreEntry entry = store.get( principal );
 
@@ -71,9 +70,9 @@ public class MapPrincipalStoreImpl imple
     }
 
 
-    public String changePassword( PrincipalName principal, String newPassword ) throws Exception
+    public String changePassword( KerberosPrincipal principal, String newPassword ) throws
Exception
     {
-        return principal.getNameString();
+        return principal.getName();
     }
 
 

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java
Fri Dec  3 15:10:54 2010
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Set;
 
 import javax.security.auth.kerberos.KerberosKey;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.kerberos.kdc.KdcContext;
@@ -146,7 +147,8 @@ public class AuthenticationService
     
     private static void getClientEntry( AuthenticationContext authContext ) throws KerberosException,
InvalidTicketException
     {
-        PrincipalName principal = authContext.getRequest().getKdcReqBody().getCName();
+        KerberosPrincipal principal = KerberosUtils.getKerberosPrincipal( 
+            authContext.getRequest().getKdcReqBody().getCName(), authContext.getRequest().getKdcReqBody().getRealm()
);
         PrincipalStore store = authContext.getStore();
 
         PrincipalStoreEntry storeEntry = getEntry( principal, store, ErrorType.KDC_ERR_C_PRINCIPAL_UNKNOWN
); 
@@ -735,7 +737,7 @@ public class AuthenticationService
      * Get a PrincipalStoreEntry given a principal.  The ErrorType is used to indicate
      * whether any resulting error pertains to a server or client.
      */
-    private static PrincipalStoreEntry getEntry( PrincipalName principal, PrincipalStore
store, ErrorType errorType )
+    private static PrincipalStoreEntry getEntry( KerberosPrincipal principal, PrincipalStore
store, ErrorType errorType )
         throws KerberosException
     {
         PrincipalStoreEntry entry = null;

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/MapPrincipalStoreImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/MapPrincipalStoreImpl.java?rev=1041856&r1=1041855&r2=1041856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/MapPrincipalStoreImpl.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/MapPrincipalStoreImpl.java
Fri Dec  3 15:10:54 2010
@@ -31,7 +31,6 @@ import org.apache.directory.server.kerbe
 import org.apache.directory.server.kerberos.shared.store.PrincipalStoreEntryModifier;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
-import org.apache.directory.shared.kerberos.components.PrincipalName;
 
 
 /**
@@ -42,7 +41,7 @@ import org.apache.directory.shared.kerbe
  */
 public class MapPrincipalStoreImpl implements PrincipalStore
 {
-    private static Map<PrincipalName, PrincipalStoreEntry> store = new HashMap<KerberosPrincipal,
PrincipalStoreEntry>();
+    private static Map<KerberosPrincipal, PrincipalStoreEntry> store = new HashMap<KerberosPrincipal,
PrincipalStoreEntry>();
 
     static
     {



Mime
View raw message