directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1043805 [2/3] - in /directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory: server/ server/kerberos/ server/kerberos/protocol/ server/kerberos/shared/ server/kerberos/shared/crypto/ server/kerberos/shared/crypto/checksu...
Date Thu, 09 Dec 2010 00:38:25 GMT
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/KdcReqBodyContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/KdcReqBodyContainer.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/KdcReqBodyContainer.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/KdcReqBodyContainer.java Thu Dec  9 00:38:21 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.kerberos.codec.kdcReqBody;
 
+import java.nio.ByteBuffer;
+
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 import org.apache.directory.shared.kerberos.components.KdcReqBody;
 
@@ -36,9 +38,9 @@ public class KdcReqBodyContainer extends
     /**
      * Creates a new KdcReqBodyContainer object.
      */
-    public KdcReqBodyContainer()
+    public KdcReqBodyContainer( ByteBuffer stream )
     {
-        super();
+        super( stream );
         this.stateStack = new int[1];
         this.grammar = KdcReqBodyGrammar.getInstance();
         setTransition( KdcReqBodyStatesEnum.START_STATE );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/AddTicket.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/AddTicket.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/AddTicket.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/AddTicket.java Thu Dec  9 00:38:21 2010
@@ -77,8 +77,7 @@ public class AddTicket extends GrammarAc
         // Now, let's decode the Ticket
         Asn1Decoder ticketDecoder = new Asn1Decoder();
         
-        TicketContainer ticketContainer = new TicketContainer();
-        ticketContainer.setStream( container.getStream() );
+        TicketContainer ticketContainer = new TicketContainer( container.getStream() );
 
         // We have to move back to the Ticket tag
         container.rewind();

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreNonce.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreNonce.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreNonce.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreNonce.java Thu Dec  9 00:38:21 2010
@@ -37,7 +37,7 @@ public class StoreNonce extends Abstract
      */
     public StoreNonce()
     {
-        super( "KDC-REQ-BODY nonce" );
+        super( "KDC-REQ-BODY nonce", Integer.MIN_VALUE, Integer.MAX_VALUE );
     }
 
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCred/KrbCredContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCred/KrbCredContainer.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCred/KrbCredContainer.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCred/KrbCredContainer.java Thu Dec  9 00:38:21 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.kerberos.codec.krbCred;
 
+import java.nio.ByteBuffer;
+
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 import org.apache.directory.shared.kerberos.messages.KrbCred;
 
@@ -35,10 +37,11 @@ public class KrbCredContainer extends Ab
     
     /**
      * Creates a new KrbErrorContainer object.
+     * @param stream The stream containing the data to decode
      */
-    public KrbCredContainer()
+    public KrbCredContainer( ByteBuffer stream )
     {
-        super();
+        super( stream );
         this.stateStack = new int[1];
         this.grammar = KrbCredGrammar.getInstance();
         setTransition( KrbCredStatesEnum.START_STATE );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCred/actions/StoreTickets.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCred/actions/StoreTickets.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCred/actions/StoreTickets.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCred/actions/StoreTickets.java Thu Dec  9 00:38:21 2010
@@ -70,8 +70,7 @@ public class StoreTickets extends Gramma
         Asn1Decoder decoder = new Asn1Decoder();
 
         // Ticket container
-        TicketContainer ticketContainer = new TicketContainer();
-        ticketContainer.setStream( container.getStream() );
+        TicketContainer ticketContainer = new TicketContainer( container.getStream() );
 
         container.rewind();
         

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorContainer.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorContainer.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorContainer.java Thu Dec  9 00:38:21 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.kerberos.codec.krbError;
 
+import java.nio.ByteBuffer;
+
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 import org.apache.directory.shared.kerberos.messages.KrbError;
 
@@ -35,10 +37,11 @@ public class KrbErrorContainer extends A
     
     /**
      * Creates a new KrbErrorContainer object.
+     * @param stream The stream containing the data to decode
      */
-    public KrbErrorContainer()
+    public KrbErrorContainer( ByteBuffer stream )
     {
-        super();
+        super( stream );
         this.stateStack = new int[1];
         this.grammar = KrbErrorGrammar.getInstance();
         setTransition( KrbErrorStatesEnum.START_STATE );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCName.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCName.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCName.java Thu Dec  9 00:38:21 2010
@@ -49,6 +49,6 @@ public class StoreCName extends Abstract
     protected void setPrincipalName( PrincipalName principalName, Asn1Container container )
     {
         KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
-        krbErrContainer.getKrbError().setcName( principalName );
+        krbErrContainer.getKrbError().setCName( principalName );
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCRealm.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCRealm.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCRealm.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCRealm.java Thu Dec  9 00:38:21 2010
@@ -48,6 +48,6 @@ public class StoreCRealm extends Abstrac
     protected void setRealm( String realm, Asn1Container container )
     {
         KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
-        krbErrContainer.getKrbError().setcRealm( realm );
+        krbErrContainer.getKrbError().setCRealm( realm );
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCTime.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCTime.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCTime.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCTime.java Thu Dec  9 00:38:21 2010
@@ -50,6 +50,6 @@ public class StoreCTime extends Abstract
     protected void setKerberosTime( KerberosTime krbtime, Asn1Container container )
     {
         KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
-        krbErrContainer.getKrbError().setcTime( krbtime );
+        krbErrContainer.getKrbError().setCTime( krbtime );
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCusec.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCusec.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCusec.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCusec.java Thu Dec  9 00:38:21 2010
@@ -38,7 +38,7 @@ public class StoreCusec extends Abstract
      */
     public StoreCusec()
     {
-        super( "KRB-ERROR cusec" );
+        super( "KRB-ERROR cusec", 0, 999999 );
     }
 
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java Thu Dec  9 00:38:21 2010
@@ -79,7 +79,7 @@ public class StoreEText extends GrammarA
         String eText = StringTools.utf8ToString( value.getData() );
 
         KrbError krbError = krbErrContainer.getKrbError();
-        krbError.seteText( eText );
+        krbError.setEText( eText );
         
         if ( IS_DEBUG )
         {

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java Thu Dec  9 00:38:21 2010
@@ -49,7 +49,7 @@ public class StoreSName extends Abstract
     protected void setPrincipalName( PrincipalName principalName, Asn1Container container )
     {
         KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
-        krbErrContainer.getKrbError().setsName( principalName );
+        krbErrContainer.getKrbError().setSName( principalName );
         container.setGrammarEndAllowed( true );
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java Thu Dec  9 00:38:21 2010
@@ -50,6 +50,6 @@ public class StoreSTime extends Abstract
     protected void setKerberosTime( KerberosTime krbtime, Asn1Container container )
     {
         KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
-        krbErrContainer.getKrbError().setsTime( krbtime );
+        krbErrContainer.getKrbError().setSTime( krbtime );
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java Thu Dec  9 00:38:21 2010
@@ -38,7 +38,7 @@ public class StoreSusec extends Abstract
      */
     public StoreSusec()
     {
-        super( "KRB-ERROR susec" );
+        super( "KRB-ERROR susec", 0, 999999 );
     }
 
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivContainer.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivContainer.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivContainer.java Thu Dec  9 00:38:21 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.shared.kerberos.codec.krbPriv;
 
 
+import java.nio.ByteBuffer;
+
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 import org.apache.directory.shared.kerberos.messages.KrbPriv;
 
@@ -37,10 +39,11 @@ public class KrbPrivContainer extends Ab
 
     /**
      * Creates a new KrbPrivContainer object.
+     * @param stream The stream containing the data to decode
      */
-    public KrbPrivContainer()
+    public KrbPrivContainer( ByteBuffer stream )
     {
-        super();
+        super( stream );
         this.stateStack = new int[1];
         this.grammar = KrbPrivGrammar.getInstance();
         setTransition( KrbPrivStatesEnum.START_STATE );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeContainer.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeContainer.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeContainer.java Thu Dec  9 00:38:21 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.kerberos.codec.krbSafe;
 
+import java.nio.ByteBuffer;
+
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 import org.apache.directory.shared.kerberos.messages.KrbSafe;
 
@@ -35,10 +37,11 @@ public class KrbSafeContainer extends Ab
     
     /**
      * Creates a new KrbSafeContainer object.
+     * @param stream The stream containing the data to decode
      */
-    public KrbSafeContainer()
+    public KrbSafeContainer( ByteBuffer stream )
     {
-        super();
+        super( stream );
         this.stateStack = new int[1];
         this.grammar = KrbSafeGrammar.getInstance();
         setTransition( KrbSafeStatesEnum.START_STATE );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafeBody/actions/StoreSeqNumber.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafeBody/actions/StoreSeqNumber.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafeBody/actions/StoreSeqNumber.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafeBody/actions/StoreSeqNumber.java Thu Dec  9 00:38:21 2010
@@ -38,7 +38,7 @@ public class StoreSeqNumber extends Abst
      */
     public StoreSeqNumber()
     {
-        super( "KRB-SAFE-BODY seq-number" );
+        super( "KRB-SAFE-BODY seq-number", Integer.MIN_VALUE, Integer.MAX_VALUE );
     }
 
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafeBody/actions/StoreUsec.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafeBody/actions/StoreUsec.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafeBody/actions/StoreUsec.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafeBody/actions/StoreUsec.java Thu Dec  9 00:38:21 2010
@@ -38,7 +38,7 @@ public class StoreUsec extends AbstractR
      */
     public StoreUsec()
     {
-        super( "KRB-SAFE-BODY usec" );
+        super( "KRB-SAFE-BODY usec", 0, 999999 );
     }
 
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/paEncTsEnc/actions/StorePaUsec.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/paEncTsEnc/actions/StorePaUsec.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/paEncTsEnc/actions/StorePaUsec.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/paEncTsEnc/actions/StorePaUsec.java Thu Dec  9 00:38:21 2010
@@ -38,7 +38,7 @@ public class StorePaUsec extends Abstrac
      */
     public StorePaUsec()
     {
-        super( "EncApRepPart pausec" );
+        super( "EncApRepPart pausec", 0, 999999 );
     }
 
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsRep/TgsRepContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsRep/TgsRepContainer.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsRep/TgsRepContainer.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsRep/TgsRepContainer.java Thu Dec  9 00:38:21 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.kerberos.codec.tgsRep;
 
+import java.nio.ByteBuffer;
+
 import org.apache.directory.shared.kerberos.codec.kdcRep.KdcRepContainer;
 import org.apache.directory.shared.kerberos.messages.TgsRep;
 
@@ -35,10 +37,11 @@ public class TgsRepContainer extends Kdc
 
     /**
      * Creates a new TgsRepContainer object.
+     * @param stream The stream containing the data to decode
      */
-    public TgsRepContainer()
+    public TgsRepContainer( ByteBuffer stream )
     {
-        super();
+        super( stream );
         this.stateStack = new int[1];
         this.grammar = TgsRepGrammar.getInstance();
         setTransition( TgsRepStatesEnum.START_STATE );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsRep/actions/StoreKdcRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsRep/actions/StoreKdcRep.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsRep/actions/StoreKdcRep.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsRep/actions/StoreKdcRep.java Thu Dec  9 00:38:21 2010
@@ -78,8 +78,7 @@ public class StoreKdcRep extends Grammar
         // Now, let's decode the KDC-REP
         Asn1Decoder kdcRepDecoder = new Asn1Decoder();
         
-        KdcRepContainer kdcRepContainer = new KdcRepContainer();
-        kdcRepContainer.setStream( container.getStream() );
+        KdcRepContainer kdcRepContainer = new KdcRepContainer( container.getStream() );
         
         // Store the created TGS-REP object into the KDC-REP container
         TgsRep tgsRep = new TgsRep();

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsReq/TgsReqContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsReq/TgsReqContainer.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsReq/TgsReqContainer.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsReq/TgsReqContainer.java Thu Dec  9 00:38:21 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.kerberos.codec.tgsReq;
 
+import java.nio.ByteBuffer;
+
 import org.apache.directory.shared.kerberos.codec.kdcReq.KdcReqContainer;
 import org.apache.directory.shared.kerberos.messages.TgsReq;
 
@@ -35,10 +37,11 @@ public class TgsReqContainer extends Kdc
 
     /**
      * Creates a new TgsReqContainer object.
+     * @param stream The stream containing the data to decode
      */
-    public TgsReqContainer()
+    public TgsReqContainer( ByteBuffer stream )
     {
-        super();
+        super( stream );
         this.stateStack = new int[1];
         this.grammar = TgsReqGrammar.getInstance();
         setTransition( TgsReqStatesEnum.START_STATE );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsReq/actions/StoreKdcReq.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsReq/actions/StoreKdcReq.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsReq/actions/StoreKdcReq.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/tgsReq/actions/StoreKdcReq.java Thu Dec  9 00:38:21 2010
@@ -78,8 +78,7 @@ public class StoreKdcReq extends Grammar
         // Now, let's decode the KDC-REQ
         Asn1Decoder kdcReqDecoder = new Asn1Decoder();
         
-        KdcReqContainer kdcReqContainer = new KdcReqContainer();
-        kdcReqContainer.setStream( container.getStream() );
+        KdcReqContainer kdcReqContainer = new KdcReqContainer( container.getStream() );
         
         // Store the created TGS-REQ object into the KDC-REQ container
         TgsReq tgsReq = new TgsReq();

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketContainer.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketContainer.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketContainer.java Thu Dec  9 00:38:21 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.kerberos.codec.ticket;
 
+import java.nio.ByteBuffer;
+
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 import org.apache.directory.shared.kerberos.messages.Ticket;
 
@@ -38,10 +40,11 @@ public class TicketContainer extends Abs
     /**
      * Creates a new TicketContainer object. We will store one grammars,
      * it's enough ...
+     * @param stream The stream containing the data to decode
      */
-    public TicketContainer()
+    public TicketContainer( ByteBuffer stream )
     {
-        super();
+        super( stream );
         this.stateStack = new int[10];
         this.grammar = TicketGrammar.getInstance();
         setTransition( TicketStatesEnum.START_STATE );

Propchange: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PaDataType.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  9 00:38:21 2010
@@ -1,3 +1,4 @@
 /directory/apacheds/branches/apacheds-codec-merge/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/PaDataType.java:982369-987590
 /directory/apacheds/branches/apacheds-config/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/PaDataType.java:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/PaDataType.java:980138-980936
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PaDataType.java:1040956-1043765

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/AuthorizationData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/AuthorizationData.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/AuthorizationData.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/AuthorizationData.java Thu Dec  9 00:38:21 2010
@@ -24,7 +24,6 @@ package org.apache.directory.shared.kerb
 import java.nio.BufferOverflowException;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
 import org.apache.directory.server.i18n.I18n;
@@ -53,89 +52,11 @@ import org.slf4j.LoggerFactory;
  */
 public class AuthorizationData extends AbstractAsn1Object
 {
-    // The inner class storing the individual ADs
-    public class AD
-    {
-        /** the type of authorization data */
-        private AuthorizationType adType;
-
-        /** the authorization data */
-        private byte[] adData;
-
-        /**
-         * @return the adType
-         */
-        public AuthorizationType getAdType()
-        {
-            return adType;
-        }
-
-        /**
-         * @return the adData
-         */
-        public byte[] getAdData()
-        {
-            return adData;
-        }
-        
-
-        /**
-         * {@inheritDoc}
-         */
-        @Override
-        public int hashCode()
-        {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + getOuterType().hashCode();
-            result = prime * result + Arrays.hashCode( adData );
-            result = prime * result + ( ( adType == null ) ? 0 : adType.hashCode() );
-            return result;
-        }
-
-        /**
-         * {@inheritDoc}
-         */
-        @Override
-        public boolean equals( Object obj )
-        {
-            if ( this == obj )
-            {
-                return true;
-            }
-            
-            if ( obj == null )
-            {
-                return false;
-            }
-            
-            AD other = ( AD ) obj;
-            
-            if ( !Arrays.equals( adData, other.adData ) )
-            {
-                return false;
-            }
-            
-            if ( adType != other.adType )
-            {
-                return false;
-            }
-
-            return true;
-        }
-
-        private AuthorizationData getOuterType()
-        {
-            return AuthorizationData.this;
-        }
-        
-    }
-    
     /** The list of AuthorizationData elements */
-    private List<AD> authorizationData = new ArrayList<AD>();
+    private List<AuthorizationDataEntry> authorizationData = new ArrayList<AuthorizationDataEntry>();
     
     /** The current AD being processed */
-    private AD currentAD;
+    private AuthorizationDataEntry currentAD;
 
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( EncryptedData.class );
@@ -156,8 +77,8 @@ public class AuthorizationData extends A
     public AuthorizationData()
     {
     }
-
-
+    
+    
     /**
      * Compute the AuthorizationData length
      * <pre>
@@ -181,12 +102,13 @@ public class AuthorizationData extends A
         authorizationDataSeqLen = new int[authorizationData.size()];
         adTypeTagLen = new int[authorizationData.size()];
         adDataTagLen = new int[authorizationData.size()];
+        authorizationDataSeqSeqLen = 0;
         
-        for ( AD ad : authorizationData )
+        for ( AuthorizationDataEntry ad : authorizationData )
         {
-            int adTypeLen = Value.getNbBytes( ad.adType.getValue() );
+            int adTypeLen = Value.getNbBytes( ad.getAdType().getValue() );
             adTypeTagLen[i] = 1 + TLV.getNbBytes( adTypeLen ) + adTypeLen;
-            adDataTagLen[i] = 1 + TLV.getNbBytes( ad.adData.length ) + ad.adData.length;
+            adDataTagLen[i] = 1 + TLV.getNbBytes( ad.getAdDataRef().length ) + ad.getAdDataRef().length;
             
             authorizationDataSeqLen[i] = 1 + TLV.getNbBytes( adTypeTagLen[i] ) + adTypeTagLen[i] + 
                                          1 + TLV.getNbBytes( adDataTagLen[i] ) + adDataTagLen[i];
@@ -221,7 +143,8 @@ public class AuthorizationData extends A
             buffer.put( TLV.getBytes( authorizationDataSeqSeqLen ) );
             
             int i = 0;
-            for ( AD ad : authorizationData )
+            
+            for ( AuthorizationDataEntry ad : authorizationData )
             {
                 buffer.put( UniversalTag.SEQUENCE.getValue() );
                 buffer.put( TLV.getBytes( authorizationDataSeqLen[i] ) );
@@ -229,12 +152,12 @@ public class AuthorizationData extends A
                 // the adType
                 buffer.put( ( byte ) KerberosConstants.AUTHORIZATION_DATA_ADTYPE_TAG );
                 buffer.put( TLV.getBytes( adTypeTagLen[i] ) );
-                Value.encode( buffer, ad.adType.getValue() );
+                Value.encode( buffer, ad.getAdType().getValue() );
     
                 // the adData
                 buffer.put( ( byte ) KerberosConstants.AUTHORIZATION_DATA_ADDATA_TAG );
                 buffer.put( TLV.getBytes( adDataTagLen[i] ) );
-                Value.encode( buffer, ad.adData );
+                Value.encode( buffer, ad.getAdDataRef() );
                 
                 i++;
             }
@@ -261,7 +184,7 @@ public class AuthorizationData extends A
      */
     public AuthorizationType getCurrentAdType()
     {
-        return currentAD.adType;
+        return currentAD.getAdType();
     }
 
 
@@ -270,7 +193,7 @@ public class AuthorizationData extends A
      */
     public void setCurrentAdType( AuthorizationType adType )
     {
-        currentAD.adType = adType;
+        currentAD.setAdType( adType );
     }
 
 
@@ -279,7 +202,7 @@ public class AuthorizationData extends A
      */
     public byte[] getCurrentAdData()
     {
-        return currentAD.adData;
+        return currentAD.getAdData();
     }
 
 
@@ -288,14 +211,14 @@ public class AuthorizationData extends A
      */
     public void setCurrentAdData( byte[] adData )
     {
-        currentAD.adData = adData;
+        currentAD.setAdData( adData );
     }
 
 
     /**
      * @return the currentAD
      */
-    public AD getCurrentAD()
+    public AuthorizationDataEntry getCurrentAD()
     {
         return currentAD;
     }
@@ -306,28 +229,28 @@ public class AuthorizationData extends A
      */
     public void createNewAD()
     {
-        currentAD = new AD();
+        currentAD = new AuthorizationDataEntry();
         authorizationData.add( currentAD );
     }
 
 
     /**
-     * @return the authorizationData
+     * Add a new AuthorizationDataEntry
      */
-    public List<AD> getAuthorizationData()
+    public void addEntry( AuthorizationDataEntry entry)
     {
-        return authorizationData;
+        authorizationData.add( entry );
     }
 
 
     /**
-     * @see Object#toString()
+     * @return the authorizationData
      */
-    public String toString()
+    public List<AuthorizationDataEntry> getAuthorizationData()
     {
-        return toString( "" );
+        return authorizationData;
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -393,14 +316,18 @@ public class AuthorizationData extends A
 
         sb.append( tabs ).append( "AuthorizationData : \n" );
         
-        for ( AD ad : authorizationData )
+        for ( AuthorizationDataEntry ad : authorizationData )
         {
-            sb.append( tabs ).append( "    {\n" );
-            sb.append( tabs ).append( "        adtype: " ).append( ad.adType ).append( '\n' );
-            sb.append( tabs ).append( "        adData: " ).append( StringTools.dumpBytes( ad.adData ) ).append( '\n');
-            sb.append( tabs ).append( "    }\n" );
+            sb.append( ad.toString( tabs + "    " ) );
         }
 
         return sb.toString();
     }
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return toString( "" );
+    }
 }

Propchange: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  9 00:38:21 2010
@@ -1,3 +1,4 @@
 /directory/apacheds/branches/apacheds-codec-merge/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java:982369-987590
 /directory/apacheds/branches/apacheds-config/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java:980138-980936
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java:1040956-1043765

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/ETypeInfoEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/ETypeInfoEntry.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/ETypeInfoEntry.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/ETypeInfoEntry.java Thu Dec  9 00:38:21 2010
@@ -69,6 +69,19 @@ public class ETypeInfoEntry extends Abst
 
     /**
      * Creates a new instance of ETypeInfoEntry.
+     * 
+     * @param etype the Encryption type
+     * @param salt the salt
+     */
+    public ETypeInfoEntry( EncryptionType etype, byte[] salt )
+    {
+        this.etype = etype;
+        this.salt = salt;
+    }
+
+
+    /**
+     * Creates a new instance of ETypeInfoEntry.
      */
     public ETypeInfoEntry()
     {

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncTicketPart.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncTicketPart.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncTicketPart.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncTicketPart.java Thu Dec  9 00:38:21 2010
@@ -32,6 +32,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.KerberosTime;
+import org.apache.directory.shared.kerberos.flags.TicketFlag;
 import org.apache.directory.shared.kerberos.flags.TicketFlags;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -64,7 +65,7 @@ public class EncTicketPart extends Abstr
     private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     /** the ticket's flags */
-    private TicketFlags flags;
+    private TicketFlags flags = new TicketFlags();
 
     /** the encryption key */
     private EncryptionKey key;
@@ -379,7 +380,7 @@ public class EncTicketPart extends Abstr
     /**
      * @return the cRealm
      */
-    public String getcRealm()
+    public String getCRealm()
     {
         return cRealm;
     }
@@ -388,7 +389,7 @@ public class EncTicketPart extends Abstr
     /**
      * @param cRealm the cRealm to set
      */
-    public void setcRealm( String cRealm )
+    public void setCRealm( String cRealm )
     {
         this.cRealm = cRealm;
     }
@@ -397,7 +398,7 @@ public class EncTicketPart extends Abstr
     /**
      * @return the cName
      */
-    public PrincipalName getcName()
+    public PrincipalName getCName()
     {
         return cName;
     }
@@ -406,7 +407,7 @@ public class EncTicketPart extends Abstr
     /**
      * @param cName the cName to set
      */
-    public void setcName( PrincipalName cName )
+    public void setCName( PrincipalName cName )
     {
         this.cName = cName;
     }
@@ -487,7 +488,7 @@ public class EncTicketPart extends Abstr
     /**
      * @return the renewtill
      */
-    public KerberosTime getRenewtill()
+    public KerberosTime getRenewTill()
     {
         return renewtill;
     }
@@ -496,7 +497,7 @@ public class EncTicketPart extends Abstr
     /**
      * @param renewtill the renewtill to set
      */
-    public void setRenewtill( KerberosTime renewtill )
+    public void setRenewTill( KerberosTime renewtill )
     {
         this.renewtill = renewtill;
     }
@@ -539,6 +540,24 @@ public class EncTicketPart extends Abstr
 
 
     /**
+     * adds the given flag to the already existing flags.
+     * If no flags exist then creates a new TicketFlags object then sets this flag
+     * and assigns the TicketFlags to this ticket part
+     * 
+     * @param flag the flag to be set
+     */
+    public void setFlag( TicketFlag flag )
+    {
+        if ( flags == null )
+        {
+            flags = new TicketFlags();
+        }
+        
+        flags.setFlag( flag.getValue() );
+    }
+    
+    
+    /**
      * @see Object#toString()
      */
     public String toString()

Propchange: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncryptionKey.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  9 00:38:21 2010
@@ -1,3 +1,4 @@
 /directory/apacheds/branches/apacheds-codec-merge/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKey.java:982369-987590
 /directory/apacheds/branches/apacheds-config/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKey.java:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKey.java:980138-980936
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncryptionKey.java:1040956-1043765

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java Thu Dec  9 00:38:21 2010
@@ -71,6 +71,9 @@ public class KdcRep extends KerberosMess
     
     /** Encoded part */
     private EncryptedData encPart;
+    
+    /** The decoded KDC-REP part */
+    protected EncKdcRepPart encKdcRepPart;
 
     // Storage for computed lengths
     private transient int pvnoLength;
@@ -215,6 +218,24 @@ public class KdcRep extends KerberosMess
 
     
     /**
+     * @return the encKdcRepPart
+     */
+    public EncKdcRepPart getEncKdcRepPart()
+    {
+        return encKdcRepPart;
+    }
+
+
+    /**
+     * @param encKdcRepPart the encKdcRepPart to set
+     */
+    public void setEncKdcRepPart( EncKdcRepPart encKdcRepPart )
+    {
+        this.encKdcRepPart = encKdcRepPart;
+    }
+    
+    
+    /**
      * Compute the KDC-REP length
      * <pre>
      * KDC-REP :
@@ -260,45 +281,47 @@ public class KdcRep extends KerberosMess
     {
         // The pvno length
         pvnoLength = 1 + 1 + 1;
-        
+        kdcRepSeqLength = 1 + TLV.getNbBytes( pvnoLength ) + pvnoLength; 
+
         // The msg-type length
         msgTypeLength = 1 + 1 + 1;
+        kdcRepSeqLength += 1 + TLV.getNbBytes( msgTypeLength ) + msgTypeLength; 
 
         // Compute the pa-data length.
-        paDataLengths = new int[paData.size()];
-        int pos = 0;
-        
-        for ( PaData paDataElem : paData )
+        if ( paData.size() != 0 )
         {
-            paDataLengths[pos] = paDataElem.computeLength();
-            paDataSeqLength += paDataLengths[pos];
-            pos++;
+            paDataLengths = new int[paData.size()];
+            int pos = 0;
+            paDataSeqLength = 0;
+            
+            for ( PaData paDataElem : paData )
+            {
+                paDataLengths[pos] = paDataElem.computeLength();
+                paDataSeqLength += paDataLengths[pos];
+                pos++;
+            }
+            
+            paDataLength = 1 + TLV.getNbBytes( paDataSeqLength ) + paDataSeqLength;
+            kdcRepSeqLength += 1 + TLV.getNbBytes( paDataLength ) + paDataLength; 
         }
         
-        paDataLength = 1 + TLV.getNbBytes( paDataSeqLength ) + paDataSeqLength;
-        
         // The crealm length
         crealmBytes = StringTools.getBytesUtf8( crealm );
         crealmLength = 1 + TLV.getNbBytes( crealmBytes.length ) + crealmBytes.length;
+        kdcRepSeqLength += 1 + TLV.getNbBytes( crealmLength ) + crealmLength; 
 
         // Compute the client principalName length
         cnameLength = cname.computeLength();
-        
+        kdcRepSeqLength += 1 + TLV.getNbBytes( cnameLength ) + cnameLength; 
+
         // Compute the ticket length
         ticketLength = ticket.computeLength();
-        
+        kdcRepSeqLength += 1 + TLV.getNbBytes( ticketLength ) + ticketLength; 
+
         // Compute the encrypted part
         encPartLength = encPart.computeLength();
-
-        // Compute the sequence size.
-        kdcRepSeqLength = 1 + TLV.getNbBytes( pvnoLength ) + pvnoLength; 
-        kdcRepSeqLength += 1 + TLV.getNbBytes( msgTypeLength ) + msgTypeLength; 
-        kdcRepSeqLength += 1 + TLV.getNbBytes( paDataLength ) + paDataLength; 
-        kdcRepSeqLength += 1 + TLV.getNbBytes( crealmLength ) + crealmLength; 
-        kdcRepSeqLength += 1 + TLV.getNbBytes( cnameLength ) + cnameLength; 
-        kdcRepSeqLength += 1 + TLV.getNbBytes( ticketLength ) + ticketLength; 
         kdcRepSeqLength += 1 + TLV.getNbBytes( encPartLength ) + encPartLength; 
-        
+
         // compute the global size
         kdcRepLength = 1 + TLV.getNbBytes( kdcRepSeqLength ) + kdcRepSeqLength;
         
@@ -340,19 +363,22 @@ public class KdcRep extends KerberosMess
         // The value
         Value.encode( buffer, getMessageType().getValue() );
         
-        // The PD-DATA --------------------------------------------------------
-        // The tag
-        buffer.put( (byte)KerberosConstants.KDC_REP_PA_DATA_TAG );
-        buffer.put( TLV.getBytes( paDataLength ) );
-        
-        // The sequence
-        buffer.put( UniversalTag.SEQUENCE.getValue() );
-        buffer.put( TLV.getBytes( paDataSeqLength ) );
-        
-        // The values
-        for ( PaData paDataElem : paData )
+        // The PD-DATA if any -------------------------------------------------
+        if ( paData.size() != 0 )
         {
-            paDataElem.encode( buffer );
+            // The tag
+            buffer.put( (byte)KerberosConstants.KDC_REP_PA_DATA_TAG );
+            buffer.put( TLV.getBytes( paDataLength ) );
+            
+            // The sequence
+            buffer.put( UniversalTag.SEQUENCE.getValue() );
+            buffer.put( TLV.getBytes( paDataSeqLength ) );
+            
+            // The values
+            for ( PaData paDataElem : paData )
+            {
+                paDataElem.encode( buffer );
+            }
         }
 
         // The CREALM ---------------------------------------------------------

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReq.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReq.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReq.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReq.java Thu Dec  9 00:38:21 2010
@@ -129,7 +129,7 @@ public abstract class KdcReq extends Ker
     {
         this.kdcReqBody = kdcReqBody;
     }
-
+    
     
     /**
      * Compute the KDC-REQ length
@@ -175,6 +175,7 @@ public abstract class KdcReq extends Ker
         {
             paDataLengths = new int[paData.size()];
             int pos = 0;
+            paDataSeqLength = 0;
             
             for ( PaData paDataElem : paData )
             {

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReqBody.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReqBody.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReqBody.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReqBody.java Thu Dec  9 00:38:21 2010
@@ -22,7 +22,9 @@ package org.apache.directory.shared.kerb
 
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
+import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.asn1.AbstractAsn1Object;
@@ -94,7 +96,7 @@ public class KdcReqBody extends Abstract
     private int nonce;
     
     /** Set of desired encryption types */
-    private List<EncryptionType> eType;
+    private Set<EncryptionType> eType;
     
     /** Addresses valid for the requested ticket */
     private HostAddresses addresses;
@@ -132,7 +134,7 @@ public class KdcReqBody extends Abstract
     public KdcReqBody()
     {
         additionalTickets = new ArrayList<Ticket>();
-        eType = new ArrayList<EncryptionType>();
+        eType = new LinkedHashSet<EncryptionType>();
     }
 
 
@@ -230,7 +232,7 @@ public class KdcReqBody extends Abstract
      *
      * @return The requested {@link EncryptionType}s.
      */
-    public List<EncryptionType> getEType()
+    public Set<EncryptionType> getEType()
     {
         return eType;
     }
@@ -239,7 +241,7 @@ public class KdcReqBody extends Abstract
     /**
      * @param eType the eType to set
      */
-    public void setEType( List<EncryptionType> eType )
+    public void setEType( Set<EncryptionType> eType )
     {
         this.eType = eType;
     }
@@ -390,7 +392,7 @@ public class KdcReqBody extends Abstract
     {
         this.till = till;
     }
-
+    
     
     /**
      * Compute the KdcReqBody length
@@ -464,44 +466,53 @@ public class KdcReqBody extends Abstract
     {
         // The KdcOptions length
         kdcOptionsLength = 1 + 1 + kdcOptions.getBytes().length;
-        
+        kdcReqBodySeqLength = 1 + TLV.getNbBytes( kdcOptionsLength ) + kdcOptionsLength; 
+
         // The cname length
         if ( cName != null )
         {
             cNameLength = cName.computeLength();
+            kdcReqBodySeqLength += 1 + TLV.getNbBytes( cNameLength ) + cNameLength;
         }
 
         // Compute the realm length.
         realmBytes = StringTools.getBytesUtf8( realm );
         realmLength = 1 + TLV.getNbBytes( realmBytes.length ) + realmBytes.length;
-        
+        kdcReqBodySeqLength += 1 + TLV.getNbBytes( realmLength ) + realmLength;
+
         // The sname length
         if ( sName != null )
         {
             sNameLength = sName.computeLength();
+            kdcReqBodySeqLength += 1 + TLV.getNbBytes( sNameLength ) + sNameLength;
         }
 
         // The from length
         if ( from != null )
         {
             fromLength = 1 + 1 + 0x0F;
+            kdcReqBodySeqLength += 1 + 1 + fromLength;
         }
 
         // The till length
         tillLength = 1 + 1 + 0x0F;
+        kdcReqBodySeqLength += 1 + 1 + tillLength;
 
         // The rtime length
         if ( rtime != null )
         {
             rtimeLength = 1 + 1 + 0x0F;
+            kdcReqBodySeqLength += 1 + 1 + rtimeLength;
         }
 
         // The nonce length
         nonceLength = 1 + 1 + Value.getNbBytes( nonce );
-        
+        kdcReqBodySeqLength += 1 + 1 + nonceLength;
+
         // The eType length
         eTypeLengths = new int[eType.size()];
         int pos = 0;
+        eTypeSeqLength = 0;
         
         for ( EncryptionType encryptionType : eType )
         {
@@ -511,23 +522,27 @@ public class KdcReqBody extends Abstract
         }
         
         eTypeLength = 1 + TLV.getNbBytes( eTypeSeqLength ) + eTypeSeqLength;
-        
+        kdcReqBodySeqLength += 1 + TLV.getNbBytes( eTypeLength ) + eTypeLength;
+
         // The Addresses length
         if ( addresses != null )
         {
             addressesLength = addresses.computeLength();
+            kdcReqBodySeqLength += 1 + TLV.getNbBytes( addressesLength ) + addressesLength;
         }
         
         // The EncAuthorizationData length
         if ( encAuthorizationData != null )
         {
             encAuthzDataLength = encAuthorizationData.computeLength();
+            kdcReqBodySeqLength += 1 + TLV.getNbBytes( encAuthzDataLength ) + encAuthzDataLength;
         }
         
         // The additionalTickets length
         if ( additionalTickets.size() != 0 )
         {
             additionalTicketsLengths = new int[additionalTickets.size()];
+            additionalTicketSeqLength = 0;
             pos = 0;
             
             for ( Ticket ticket : additionalTickets )
@@ -538,52 +553,9 @@ public class KdcReqBody extends Abstract
             }
             
             additionalTicketLength = 1 + TLV.getNbBytes( additionalTicketSeqLength ) + additionalTicketSeqLength;
-        }
-
-        // Compute the sequence size.
-        // The mandatory fields first
-        kdcReqBodySeqLength = 1 + TLV.getNbBytes( kdcOptionsLength ) + kdcOptionsLength; 
-        kdcReqBodySeqLength += 1 + TLV.getNbBytes( realmLength ) + realmLength;
-        kdcReqBodySeqLength += 1 + 1 + tillLength;
-        kdcReqBodySeqLength += 1 + 1 + nonceLength;
-        kdcReqBodySeqLength += 1 + TLV.getNbBytes( eTypeLength ) + eTypeLength;
-        
-        // The optional fields
-        if ( cName != null )
-        {
-            kdcReqBodySeqLength += 1 + TLV.getNbBytes( cNameLength ) + cNameLength;
-        }
-        
-        if ( sName != null )
-        {
-            kdcReqBodySeqLength += 1 + TLV.getNbBytes( sNameLength ) + sNameLength;
-        }
-        
-        if ( from != null )
-        {
-            kdcReqBodySeqLength += 1 + 1 + fromLength;
-        }
-        
-        if ( rtime != null )
-        {
-            kdcReqBodySeqLength += 1 + 1 + rtimeLength;
-        }
-
-        if ( addresses != null )
-        {
-            kdcReqBodySeqLength += 1 + TLV.getNbBytes( addressesLength ) + addressesLength;
-        }
-        
-        if ( encAuthorizationData != null )
-        {
-            kdcReqBodySeqLength += 1 + TLV.getNbBytes( encAuthzDataLength ) + encAuthzDataLength;
-        }
-        
-        if ( additionalTickets.size() != 0 )
-        {
             kdcReqBodySeqLength += 1 + TLV.getNbBytes( additionalTicketLength ) + additionalTicketLength;
         }
-        
+
         // compute the global size
         kdcReqBodyLength = 1 + TLV.getNbBytes( kdcReqBodySeqLength ) + kdcReqBodySeqLength;
         

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/LastReq.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/LastReq.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/LastReq.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/LastReq.java Thu Dec  9 00:38:21 2010
@@ -59,38 +59,11 @@ public class LastReq extends AbstractAsn
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
-    // The inner class storing the individual LastReqs
-    public class LR
-    {
-        /** The LastReq type. */
-        private LastReqType lrType;
-
-        /** The LastReq value */
-        private KerberosTime lrValue;
-
-
-        /**
-         * @return the LastReqType
-         */
-        public LastReqType getLrType()
-        {
-            return lrType;
-        }
-
-        /**
-         * @return the lr-value
-         */
-        public KerberosTime getLrValue()
-        {
-            return lrValue;
-        }
-    }
-    
     /** The list of LastReq elements */
-    private List<LR> lastReqs = new ArrayList<LR>();
+    private List<LastReqEntry> lastReqs = new ArrayList<LastReqEntry>();
     
-    /** The current LR being processed */
-    private LR currentLR;
+    /** The current LastReqEntry being processed */
+    private LastReqEntry currentLR;
 
 
     // Storage for computed lengths
@@ -113,7 +86,7 @@ public class LastReq extends AbstractAsn
      */
     public LastReqType getCurrentLrType()
     {
-        return currentLR.lrType;
+        return currentLR.getLrType();
     }
 
 
@@ -122,7 +95,7 @@ public class LastReq extends AbstractAsn
      */
     public void setCurrentLrType( LastReqType lrType )
     {
-        currentLR.lrType = lrType;
+        currentLR.setLrType( lrType );
     }
 
 
@@ -131,7 +104,7 @@ public class LastReq extends AbstractAsn
      */
     public KerberosTime getCurrentLrValue()
     {
-        return currentLR.lrValue;
+        return currentLR.getLrValue();
     }
 
 
@@ -140,14 +113,14 @@ public class LastReq extends AbstractAsn
      */
     public void setCurrentLrValue( KerberosTime lrValue )
     {
-        currentLR.lrValue = lrValue;
+        currentLR.setLrValue( lrValue );
     }
 
 
     /**
      * @return the CurrentLR
      */
-    public LR getCurrentLR()
+    public LastReqEntry getCurrentLR()
     {
         return currentLR;
     }
@@ -158,21 +131,31 @@ public class LastReq extends AbstractAsn
      */
     public void createNewLR()
     {
-        currentLR = new LR();
+        currentLR = new LastReqEntry();
         lastReqs.add( currentLR );
     }
 
 
     /**
-     * @return the LastReqs
+     * Add a new LastReqEntry
+     * @param lastReqEntry The enry to add
      */
-    public List<LR> getLastReqs()
+    public void addEntry( LastReqEntry lastReqEntry)
     {
-        return lastReqs;
+        lastReqs.add( lastReqEntry );
     }
 
 
     /**
+     * @return the LastReqs
+     */
+    public List<LastReqEntry> getLastReqs()
+    {
+        return lastReqs;
+    }
+    
+    
+    /**
      * Compute the LastReq length
      * 
      * <pre>
@@ -197,13 +180,13 @@ public class LastReq extends AbstractAsn
         lastReqSeqLen = new int[lastReqs.size()];
         lrTypeTagLen = new int[lastReqs.size()];
         lrValueTagLen = new int[lastReqs.size()];
-        lastReqSeqLen = new int[lastReqs.size()];
+        lastReqSeqSeqLen = 0;
         
-        for ( LR lr : lastReqs )
+        for ( LastReqEntry lre : lastReqs )
         {
-            int lrTypeLen = Value.getNbBytes( lr.lrType.getValue() );
+            int lrTypeLen = Value.getNbBytes( lre.getLrType().getValue() );
             lrTypeTagLen[i] = 1 + TLV.getNbBytes( lrTypeLen ) + lrTypeLen;
-            byte[] lrValyeBytes = lr.lrValue.getBytes();
+            byte[] lrValyeBytes = lre.getLrValue().getBytes();
             lrValueTagLen[i] = 1 + TLV.getNbBytes( lrValyeBytes.length ) + lrValyeBytes.length;
             
             lastReqSeqLen[i] = 1 + TLV.getNbBytes( lrTypeTagLen[i] ) + lrTypeTagLen[i] + 
@@ -250,7 +233,7 @@ public class LastReq extends AbstractAsn
             
             int i = 0;
             
-            for ( LR lr : lastReqs )
+            for ( LastReqEntry lre : lastReqs )
             {
                 buffer.put( UniversalTag.SEQUENCE.getValue() );
                 buffer.put( TLV.getBytes( lastReqSeqLen[i] ) );
@@ -258,7 +241,7 @@ public class LastReq extends AbstractAsn
                 // the lrType
                 buffer.put( ( byte ) KerberosConstants.LAST_REQ_LR_TYPE_TAG );
                 buffer.put( TLV.getBytes( lrTypeTagLen[i] ) );
-                Value.encode( buffer, lr.lrType.getValue() );
+                Value.encode( buffer, lre.getLrType().getValue() );
     
                 // the lrValue tag
                 buffer.put( ( byte ) KerberosConstants.LAST_REQ_LR_VALUE_TAG );
@@ -267,7 +250,7 @@ public class LastReq extends AbstractAsn
                 // the lrValue value
                 buffer.put( ( byte ) UniversalTag.GENERALIZED_TIME.getValue() );
                 buffer.put( ( byte ) 0x0F );
-                buffer.put( lr.lrValue.getBytes() );
+                buffer.put( lre.getLrValue().getBytes() );
             }
         }
         catch ( BufferOverflowException boe )
@@ -290,20 +273,26 @@ public class LastReq extends AbstractAsn
     /**
      * @see Object#toString()
      */
-    public String toString()
+    public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
 
-        sb.append( "LastReq : {\n" );
+        sb.append( tabs ).append( "LastReq : \n" );
         
-        for ( LR lr : lastReqs )
+        for ( LastReqEntry lre : lastReqs )
         {
-            sb.append( "    {\n" );
-            sb.append( "        lr-type: " ).append( lr.lrType ).append( '\n' );
-            sb.append( "        lr-value: " ).append( lr.lrValue ).append( '\n');
-            sb.append( "    }\n" );
+            sb.append( lre.toString( tabs + "    " ) );
         }
 
         return sb.toString();
     }
+    
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return toString( "" );
+    }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java Thu Dec  9 00:38:21 2010
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The Pre-Authentication data. Tha ASN.1 GRAMMAR IS :
+ * The Pre-Authentication data. The ASN.1 GRAMMAR IS :
  * <pre>
  * PA-DATA         ::= SEQUENCE {
  *         -- NOTE: first tag is [1], not [0]

Propchange: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  9 00:38:21 2010
@@ -1,3 +1,4 @@
 /directory/apacheds/branches/apacheds-codec-merge/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PaData.java:982369-987590
 /directory/apacheds/branches/apacheds-config/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PaData.java:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PaData.java:980138-980936
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java:1040956-1043765

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaEncTsEnc.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaEncTsEnc.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaEncTsEnc.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaEncTsEnc.java Thu Dec  9 00:38:21 2010
@@ -77,6 +77,16 @@ public class PaEncTsEnc extends Abstract
 
     
     /**
+     * Creates a new instance of PaEncTsEnc.
+     */
+    public PaEncTsEnc( KerberosTime paTimestamp, int pausec )
+    {
+        this.patimestamp = paTimestamp;
+        this.pausec = pausec;
+    }
+
+    
+    /**
      * Returns the patimestamp value.
      *
      * @return The patimestamp value.

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PrincipalName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PrincipalName.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PrincipalName.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PrincipalName.java Thu Dec  9 00:38:21 2010
@@ -190,9 +190,16 @@ public class PrincipalName extends Abstr
      * @param nameString
      * @param nameType
      */
-    public PrincipalName( String nameString, int nameType ) throws ParseException
+    public PrincipalName( String nameString, int nameType )
     {
-        this.nameString = KerberosUtils.getNames( nameString );
+        try
+        {
+            this.nameString = KerberosUtils.getNames( nameString );
+        }
+        catch ( ParseException pe )
+        {
+            throw new IllegalArgumentException( pe );
+        }
         
         this.nameType = PrincipalNameType.getTypeByValue( nameType );
     }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/TypedData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/TypedData.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/TypedData.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/TypedData.java Thu Dec  9 00:38:21 2010
@@ -158,8 +158,8 @@ public class TypedData extends AbstractA
     {
         return typedDataList;
     }
-
-
+    
+    
     /**
      * Compute the TypedData length
      * <pre>
@@ -183,6 +183,7 @@ public class TypedData extends AbstractA
         typedDataSeqLength = new int[typedDataList.size()];
         dataTypeTagLength = new int[typedDataList.size()];
         dataValueTagLength = new int[typedDataList.size()];
+        typedDataSeqSeqLength = 0;
 
         for ( TD td : typedDataList )
         {

Propchange: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  9 00:38:21 2010
@@ -1,3 +1,4 @@
 /directory/apacheds/branches/apacheds-codec-merge/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumType.java:982369-987590
 /directory/apacheds/branches/apacheds-config/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumType.java:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumType.java:980138-980936
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java:1040956-1043765

Propchange: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  9 00:38:21 2010
@@ -1,3 +1,4 @@
 /directory/apacheds/branches/apacheds-codec-merge/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags:982369-987590
 /directory/apacheds/branches/apacheds-config/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags:980138-980936
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags:1040956-1043765

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java Thu Dec  9 00:38:21 2010
@@ -26,7 +26,10 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.KerberosMessageType;
+import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.components.KdcRep;
+import org.apache.directory.shared.kerberos.components.PrincipalName;
+import org.apache.directory.shared.kerberos.flags.TicketFlags;
 
 
 /**
@@ -51,8 +54,74 @@ public class AsRep extends KdcRep
         super( KerberosMessageType.AS_REP );
     }
 
+
+    /**
+     * Returns the end {@link KerberosTime}.
+     *
+     * @return The end {@link KerberosTime}.
+     */
+    public KerberosTime getEndTime()
+    {
+        return encKdcRepPart.getEndTime();
+    }
+
+    
+    /**
+     * Returns the {@link TicketFlags}.
+     *
+     * @return The {@link TicketFlags}.
+     */
+    public TicketFlags getFlags()
+    {
+        return encKdcRepPart.getFlags();
+    }
+
+
+    /**
+     * Returns the nonce.
+     *
+     * @return The nonce.
+     */
+    public int getNonce()
+    {
+        return encKdcRepPart.getNonce();
+    }
+
+
+    /**
+     * Returns the renew till {@link KerberosTime}.
+     *
+     * @return The renew till {@link KerberosTime}.
+     */
+    public KerberosTime getRenewTill()
+    {
+        return encKdcRepPart.getRenewTill();
+    }
+
+
+    /**
+     * Returns the start {@link KerberosTime}.
+     *
+     * @return The start {@link KerberosTime}.
+     */
+    public KerberosTime getStartTime()
+    {
+        return encKdcRepPart.getStartTime();
+    }
+    
     
     /**
+     * Returns the server {@link PrincipalName}.
+     *
+     * @return The server {@link PrincipalName}.
+     */
+    public PrincipalName getSName()
+    {
+        return encKdcRepPart.getSName();
+    }
+
+
+    /**
      * Compute the AS-REP length
      * <pre>
      * AS-REP :

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/Authenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/Authenticator.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/Authenticator.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/Authenticator.java Thu Dec  9 00:38:21 2010
@@ -328,74 +328,53 @@ public class Authenticator extends Kerbe
     {
         // Compute the Authenticator version length.
         authenticatorVnoLength = 1 + 1 + Value.getNbBytes( getProtocolVersionNumber() );
+        authenticatorSeqLength =  1 + TLV.getNbBytes( authenticatorVnoLength ) + authenticatorVnoLength;
 
         // Compute the  crealm length.
         crealmBytes = StringTools.getBytesUtf8( crealm );
         crealmLength = 1 + TLV.getNbBytes( crealmBytes.length ) + crealmBytes.length;
+        authenticatorSeqLength += 1 + TLV.getNbBytes( crealmLength ) + crealmLength;
 
         // Compute the cname length
         cnameLength = cname.computeLength();
+        authenticatorSeqLength += 1 + TLV.getNbBytes( cnameLength ) + cnameLength;
         
         // Compute the cksum length if any
         if ( cksum != null )
         {
             cksumLength = cksum.computeLength();
+            authenticatorSeqLength += 1 + TLV.getNbBytes( cksumLength ) + cksumLength;
         }
 
         // Compute the cusec length
         cusecLength = 1 + 1 + Value.getNbBytes( cusec );
+        authenticatorSeqLength += 1 + TLV.getNbBytes( cusecLength ) + cusecLength;
 
         // Compute the ctime length
         ctimeLength = 1 + 1 + 0x0F;
+        authenticatorSeqLength += 1 + 1 + ctimeLength;
 
         // Compute the subkey length if any
         if ( subKey != null )
         {
             subkeyLength = subKey.computeLength();
+            authenticatorSeqLength += 1 + TLV.getNbBytes( subkeyLength ) + subkeyLength;
         }
 
         // Compute the seq-number  length if any
         if ( seqNumber != null )
         {
             seqNumberLength = 1 + 1 + Value.getNbBytes( seqNumber );
+            authenticatorSeqLength += 1 + TLV.getNbBytes( seqNumberLength ) + seqNumberLength;
         }
         
         // Compute the authorization-data length if any
         if ( authorizationData != null )
         {
             authorizationDataLength = authorizationData.computeLength();
-        }
-
-
-        // Compute the sequence size
-        authenticatorSeqLength = 
-            1 + TLV.getNbBytes( authenticatorVnoLength ) + authenticatorVnoLength +
-            1 + TLV.getNbBytes( crealmLength ) + crealmLength +
-            1 + TLV.getNbBytes( cnameLength ) + cnameLength + 
-            1 + TLV.getNbBytes( cusecLength ) + cusecLength +
-            1 + TLV.getNbBytes( ctimeLength ) + ctimeLength;
-
-        // The optional fields
-        if ( cksum != null )
-        {
-            authenticatorSeqLength += 1 + TLV.getNbBytes( cksumLength ) + cksumLength;
-        }
-
-        if ( subKey != null )
-        {
-            authenticatorSeqLength += 1 + TLV.getNbBytes( subkeyLength ) + subkeyLength;
-        }
-
-        if ( seqNumber != null )
-        {
-            authenticatorSeqLength += 1 + TLV.getNbBytes( seqNumberLength ) + seqNumberLength;
-        }
-
-        if ( authorizationData != null )
-        {
             authenticatorSeqLength += 1 + TLV.getNbBytes( authorizationDataLength ) + authorizationDataLength;
         }
-        
+
         // compute the global size
         authenticatorLength = 1 + TLV.getNbBytes( authenticatorSeqLength ) + authenticatorSeqLength;
         

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java?rev=1043805&r1=1043804&r2=1043805&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java Thu Dec  9 00:38:21 2010
@@ -135,7 +135,7 @@ public class KrbError extends KerberosMe
     /**
      * @return the cTime
      */
-    public KerberosTime getcTime()
+    public KerberosTime getCTime()
     {
         return cTime;
     }
@@ -144,7 +144,7 @@ public class KrbError extends KerberosMe
     /**
      * @param cTime the cTime to set
      */
-    public void setcTime( KerberosTime cTime )
+    public void setCTime( KerberosTime cTime )
     {
         this.cTime = cTime;
     }
@@ -176,7 +176,7 @@ public class KrbError extends KerberosMe
     /**
      * @return the sTime
      */
-    public KerberosTime getsTime()
+    public KerberosTime getSTime()
     {
         return sTime;
     }
@@ -185,7 +185,7 @@ public class KrbError extends KerberosMe
     /**
      * @param sTime the sTime to set
      */
-    public void setsTime( KerberosTime sTime )
+    public void setSTime( KerberosTime sTime )
     {
         this.sTime = sTime;
     }
@@ -230,7 +230,7 @@ public class KrbError extends KerberosMe
     /**
      * @return the cRealm
      */
-    public String getcRealm()
+    public String getCRealm()
     {
         return cRealm;
     }
@@ -239,7 +239,7 @@ public class KrbError extends KerberosMe
     /**
      * @param cRealm the cRealm to set
      */
-    public void setcRealm( String cRealm )
+    public void setCRealm( String cRealm )
     {
         this.cRealm = cRealm;
     }
@@ -248,7 +248,7 @@ public class KrbError extends KerberosMe
     /**
      * @return the cName
      */
-    public PrincipalName getcName()
+    public PrincipalName getCName()
     {
         return cName;
     }
@@ -257,7 +257,7 @@ public class KrbError extends KerberosMe
     /**
      * @param cName the cName to set
      */
-    public void setcName( PrincipalName cName )
+    public void setCName( PrincipalName cName )
     {
         this.cName = cName;
     }
@@ -284,7 +284,7 @@ public class KrbError extends KerberosMe
     /**
      * @return the sName
      */
-    public PrincipalName getsName()
+    public PrincipalName getSName()
     {
         return sName;
     }
@@ -293,7 +293,7 @@ public class KrbError extends KerberosMe
     /**
      * @param sName the sName to set
      */
-    public void setsName( PrincipalName sName )
+    public void setSName( PrincipalName sName )
     {
         this.sName = sName;
     }
@@ -302,7 +302,7 @@ public class KrbError extends KerberosMe
     /**
      * @return the eText
      */
-    public String geteText()
+    public String getEText()
     {
         return eText;
     }
@@ -311,7 +311,7 @@ public class KrbError extends KerberosMe
     /**
      * @param eText the eText to set
      */
-    public void seteText( String eText )
+    public void setEText( String eText )
     {
         this.eText = eText;
     }
@@ -320,7 +320,7 @@ public class KrbError extends KerberosMe
     /**
      * @return the eData
      */
-    public byte[] geteData()
+    public byte[] getEData()
     {
         return eData;
     }
@@ -399,96 +399,82 @@ public class KrbError extends KerberosMe
      */
     public int computeLength()
     {
+        // The PVNO
         pvnoLength = 1 + 1 + 1;
+        krbErrorSeqLength = 1 + TLV.getNbBytes( pvnoLength ) + pvnoLength;
 
+        // The message type
         msgTypeLength = 1 + 1 + Value.getNbBytes( getMessageType().getValue() );
+        krbErrorSeqLength += 1 + TLV.getNbBytes( msgTypeLength ) + msgTypeLength;
 
+        // The ctime, if any
         if ( cTime != null )
         {
             cTimeLength = 1 + 1 + 0x0F;
+            krbErrorSeqLength += 1 + TLV.getNbBytes( cTimeLength ) + cTimeLength;
         }
 
+        // The cusec, if any
         if ( cusec != null )
         {
             int cusecLen = Value.getNbBytes( cusec );
             cusecLength = 1 + TLV.getNbBytes( cusecLen ) + cusecLen;
+            krbErrorSeqLength += 1 + TLV.getNbBytes( cusecLength ) + cusecLength;
         }
 
+        // The stime
         sTimeLength = 1 + 1 + 0x0F;
+        krbErrorSeqLength += 1 + TLV.getNbBytes( sTimeLength ) + sTimeLength;
 
+        // The susec
         int susecLen = Value.getNbBytes( susec );
         susecLength = 1 + TLV.getNbBytes( susecLen ) + susecLen;
+        krbErrorSeqLength += 1 + TLV.getNbBytes( susecLength ) + susecLength;
 
+        // The error-code
         errorCodeLength = 1 + 1 + Value.getNbBytes( errorCode.getOrdinal() );
+        krbErrorSeqLength += 1 + TLV.getNbBytes( errorCodeLength ) + errorCodeLength;
 
+        // The crealm, if any
         if ( cRealm != null )
         {
             crealmBytes = StringTools.getBytesUtf8( cRealm );
             cRealmLength = 1 + TLV.getNbBytes( crealmBytes.length ) + crealmBytes.length;
+            krbErrorSeqLength += 1 + TLV.getNbBytes( cRealmLength ) + cRealmLength;
         }
 
+        // The cname if any
         if ( cName != null )
         {
             cNameLength = cName.computeLength();
+            krbErrorSeqLength += 1 + TLV.getNbBytes( cNameLength ) + cNameLength;
         }
 
+        // The realm
         realmBytes = StringTools.getBytesUtf8( realm );
         realmLength = 1 + TLV.getNbBytes( realmBytes.length ) + realmBytes.length;
+        krbErrorSeqLength += 1 + TLV.getNbBytes( realmLength ) + realmLength;
 
+        // The sname
         sNameLength = sName.computeLength();
+        krbErrorSeqLength += 1 + TLV.getNbBytes( sNameLength ) + sNameLength;
 
+        // The e-text, if any
         if ( eText != null )
         {
             eTextBytes = StringTools.getBytesUtf8( eText );
             eTextLength = 1 + TLV.getNbBytes( eTextBytes.length ) + eTextBytes.length;
-        }
-
-        if ( eData != null )
-        {
-            eDataLength = 1 + TLV.getNbBytes( eData.length ) + eData.length;
-        }
-        
-        // Compute the sequence size.
-        // The mandatory fields first
-        krbErrorSeqLength = 1 + TLV.getNbBytes( pvnoLength ) + pvnoLength;
-        krbErrorSeqLength += 1 + TLV.getNbBytes( msgTypeLength ) + msgTypeLength;
-        krbErrorSeqLength += 1 + TLV.getNbBytes( sTimeLength ) + sTimeLength;
-        krbErrorSeqLength += 1 + TLV.getNbBytes( susecLength ) + susecLength;
-        krbErrorSeqLength += 1 + TLV.getNbBytes( errorCodeLength ) + errorCodeLength;
-        krbErrorSeqLength += 1 + TLV.getNbBytes( realmLength ) + realmLength;
-        krbErrorSeqLength += 1 + TLV.getNbBytes( sNameLength ) + sNameLength;
-
-        // The optional fields then
-        if ( cTime != null )
-        {
-            krbErrorSeqLength += 1 + TLV.getNbBytes( cTimeLength ) + cTimeLength;
-        }
-
-        if ( cusec != null )
-        {
-            krbErrorSeqLength += 1 + TLV.getNbBytes( cusecLength ) + cusecLength;
-        }
-
-        if ( cRealm != null )
-        {
-            krbErrorSeqLength += 1 + TLV.getNbBytes( cRealmLength ) + cRealmLength;
-        }
-
-        if ( cName != null )
-        {
-            krbErrorSeqLength += 1 + TLV.getNbBytes( cNameLength ) + cNameLength;
-        }
-
-        if ( eText != null )
-        {
             krbErrorSeqLength += 1 + TLV.getNbBytes( eTextLength ) + eTextLength;
         }
 
+        // The e-data, if any
         if ( eData != null )
         {
+            eDataLength = 1 + TLV.getNbBytes( eData.length ) + eData.length;
             krbErrorSeqLength += 1 + TLV.getNbBytes( eDataLength ) + eDataLength;
         }
-        
+
+        // The global sequence length
         krbErrorLength = 1 + TLV.getNbBytes( krbErrorSeqLength ) + krbErrorSeqLength;
 
         return 1 + TLV.getNbBytes( krbErrorLength ) + krbErrorLength;

Propchange: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  9 00:38:21 2010
@@ -1,5 +1,6 @@
 /directory/apacheds/branches/apacheds-codec-merge/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KrbError.java:982369-987590
 /directory/apacheds/branches/apacheds-config/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KrbError.java:1023442-1029077
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java:1040956-1043765
 /directory/apacheds/branches/apacheds-replication/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KrbError.java:749790-764110
 /directory/apacheds/branches/apacheds-schema/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KrbError.java:806623-896441
 /directory/apacheds/branches/apacheds-subtree/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KrbError.java:965203-965686



Mime
View raw message