directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1042674 - /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
Date Mon, 06 Dec 2010 15:22:17 GMT
Author: elecharny
Date: Mon Dec  6 15:22:16 2010
New Revision: 1042674

URL: http://svn.apache.org/viewvc?rev=1042674&view=rev
Log:
The PaData length was still counted in the global PDU length. Fixed

Modified:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java?rev=1042674&r1=1042673&r2=1042674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
Mon Dec  6 15:22:16 2010
@@ -260,9 +260,11 @@ 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.
         if ( paData.size() != 0 )
@@ -278,30 +280,26 @@ public class KdcRep extends KerberosMess
             }
             
             paDataLength = 1 + TLV.getNbBytes( paDataSeqLength ) + paDataSeqLength;
+            kdcRepSeqLength += 1 + TLV.getNbBytes( paDataLength ) + paDataLength; 
         }
         
         // 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;
         



Mime
View raw message