directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r605767 - /directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DefaultBindHandler.java
Date Thu, 20 Dec 2007 01:00:17 GMT
Author: erodriguez
Date: Wed Dec 19 17:00:16 2007
New Revision: 605767

URL: http://svn.apache.org/viewvc?rev=605767&view=rev
Log:
Added support to LDAP SASL GSSAPI for different Kerberos encryption types (DIRSERVER-1113):
o  Call to retrieve Subject now iterates over all keys returned for the LDAP service principal
and adds the keys to the private credentials.

Modified:
    directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DefaultBindHandler.java

Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DefaultBindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DefaultBindHandler.java?rev=605767&r1=605766&r2=605767&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DefaultBindHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DefaultBindHandler.java
Wed Dec 19 17:00:16 2007
@@ -68,6 +68,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Hashtable;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -481,14 +482,22 @@
             throw new ServiceConfigurationException( message );
         }
 
-        EncryptionKey key = entry.getKeyMap().get( EncryptionType.DES_CBC_MD5 );
-        byte[] keyBytes = key.getKeyValue();
-        int type = key.getKeyType().getOrdinal();
-        int kvno = key.getKeyVersion();
-
-        KerberosKey serviceKey = new KerberosKey( servicePrincipal, keyBytes, type, kvno
);
         Subject subject = new Subject();
-        subject.getPrivateCredentials().add( serviceKey );
+
+        Iterator<EncryptionType> it = entry.getKeyMap().keySet().iterator();
+
+        while ( it.hasNext() )
+        {
+            EncryptionKey key = entry.getKeyMap().get( it.next() );
+
+            byte[] keyBytes = key.getKeyValue();
+            int type = key.getKeyType().getOrdinal();
+            int kvno = key.getKeyVersion();
+
+            KerberosKey serviceKey = new KerberosKey( servicePrincipal, keyBytes, type, kvno
);
+
+            subject.getPrivateCredentials().add( serviceKey );
+        }
 
         return subject;
     }



Mime
View raw message