directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1041094 - in /directory/apacheds/branches/apacheds-kerberos-codec-2.0: kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/
Date Wed, 01 Dec 2010 17:28:02 GMT
Author: elecharny
Date: Wed Dec  1 17:28:02 2010
New Revision: 1041094

URL: http://svn.apache.org/viewvc?rev=1041094&view=rev
Log:
Fixed some errors in the way we handle the first decoding layer for Kerberos

Modified:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageGrammar.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageGrammar.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/codec/KerberosMessageGrammar.java?rev=1041094&r1=1041093&r2=1041094&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageGrammar.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageGrammar.java
Wed Dec  1 17:28:02 2010
@@ -78,6 +78,7 @@ public final class KerberosMessageGramma
             stream.rewind();
             
             TLV tlv = kerberosMessageContainer.getCurrentTLV();
+            kerberosMessageContainer.setGrammarEndAllowed( true );
 
             // Now, dependening on the T, call the inner decoder
             switch ( tlv.getTag() )

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java?rev=1041094&r1=1041093&r2=1041094&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java
Wed Dec  1 17:28:02 2010
@@ -24,7 +24,8 @@ import java.io.IOException;
 import java.nio.ByteBuffer;
 
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
+import org.apache.directory.shared.asn1.ber.tlv.TLV;
+import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.kerberos.codec.KerberosMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
@@ -64,6 +65,7 @@ public class KerberosUdpDecoder extends 
             kerberosMessageContainer = new KerberosMessageContainer();
             session.setAttribute( KERBEROS_MESSAGE_CONTAINER, kerberosMessageContainer );
             kerberosMessageContainer.setStream( buf );
+            kerberosMessageContainer.setGathering( true );
         }
         
         while ( buf.hasRemaining() )
@@ -71,8 +73,11 @@ public class KerberosUdpDecoder extends 
             try
             {
                 asn1Decoder.decode( buf, kerberosMessageContainer );
+                
+                TLV tlv = kerberosMessageContainer.getCurrentTLV();
+                Value value = tlv.getValue();
 
-                if ( kerberosMessageContainer.getState() == TLVStateEnum.PDU_DECODED )
+                if ( ( value.getData() != null ) && ( value.getData().length == tlv.getLength()
) )
                 {
                     if ( IS_DEBUG )
                     {



Mime
View raw message