directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1041653 - /directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
Date Fri, 03 Dec 2010 00:02:45 GMT
Author: elecharny
Date: Fri Dec  3 00:02:44 2010
New Revision: 1041653

URL: http://svn.apache.org/viewvc?rev=1041653&view=rev
Log:
Fixed a compilation error

Modified:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java?rev=1041653&r1=1041652&r2=1041653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
Fri Dec  3 00:02:44 2010
@@ -20,12 +20,11 @@
 package org.apache.directory.server.core.kerberos;
 
 
-import java.io.IOException;
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -54,8 +53,8 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.server.kerberos.shared.crypto.encryption.KerberosKeyFactory;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.RandomKeyFactory;
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
-import org.apache.directory.server.kerberos.shared.io.encoder.EncryptionKeyEncoder;
 import org.apache.directory.server.kerberos.shared.store.KerberosAttribute;
+import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -399,15 +398,15 @@ public class KeyDerivationInterceptor ex
             new DefaultEntryAttribute( KerberosAttribute.KRB5_KEY_AT,
                 schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_KEY_AT
) );
 
-        Iterator<EncryptionKey> it = keys.values().iterator();
-
-        while ( it.hasNext() )
+        for ( EncryptionKey encryptionKey : keys.values() )
         {
             try
             {
-                keyAttribute.add( EncryptionKeyEncoder.encode( it.next() ) );
+                ByteBuffer buffer = ByteBuffer.allocate( encryptionKey.computeLength() );
+                encryptionKey.encode( buffer );
+                keyAttribute.add( buffer.array() );
             }
-            catch ( IOException ioe )
+            catch ( EncoderException ioe )
             {
                 log.error( I18n.err( I18n.ERR_122 ), ioe );
             }



Mime
View raw message