directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1036987 - in /directory/apacheds/trunk/kerberos-codec/src: main/java/org/apache/directory/shared/kerberos/codec/authenticator/ main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/ main/java/org/apache/directory/share...
Date Fri, 19 Nov 2010 19:47:10 GMT
Author: elecharny
Date: Fri Nov 19 19:47:09 2010
New Revision: 1036987

URL: http://svn.apache.org/viewvc?rev=1036987&view=rev
Log:
o fixed many errors in Authenticator
o Added some tests for it

Added:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreCTime.java
    directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AuthenticatorDecoderTest.java
Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorGrammar.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthorizationData.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSeqNumber.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSubKey.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/Authenticator.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorGrammar.java?rev=1036987&r1=1036986&r2=1036987&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorGrammar.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorGrammar.java
Fri Nov 19 19:47:09 2010
@@ -31,11 +31,11 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.codec.authenticator.actions.StoreAuthorizationData;
 import org.apache.directory.shared.kerberos.codec.authenticator.actions.StoreCName;
 import org.apache.directory.shared.kerberos.codec.authenticator.actions.StoreCRealm;
+import org.apache.directory.shared.kerberos.codec.authenticator.actions.StoreCTime;
 import org.apache.directory.shared.kerberos.codec.authenticator.actions.StoreChecksum;
 import org.apache.directory.shared.kerberos.codec.authenticator.actions.StoreCusec;
 import org.apache.directory.shared.kerberos.codec.authenticator.actions.StoreSeqNumber;
 import org.apache.directory.shared.kerberos.codec.authenticator.actions.StoreSubKey;
-import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreCTime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthorizationData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthorizationData.java?rev=1036987&r1=1036986&r2=1036987&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthorizationData.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthorizationData.java
Fri Nov 19 19:47:09 2010
@@ -51,5 +51,6 @@ public class StoreAuthorizationData exte
     {
         AuthenticatorContainer authenticatorContainer = ( AuthenticatorContainer ) container;
         authenticatorContainer.getAuthenticator().setAuthorizationData( authorizationData
);
+        authenticatorContainer.setGrammarEndAllowed( true );
     }
 }

Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreCTime.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreCTime.java?rev=1036987&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreCTime.java
(added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreCTime.java
Fri Nov 19 19:47:09 2010
@@ -0,0 +1,56 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.kerberos.codec.authenticator.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.KerberosTime;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadKerberosTime;
+import org.apache.directory.shared.kerberos.codec.authenticator.AuthenticatorContainer;
+
+
+/**
+ * The action used to store the ctime KerberosTime
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreCTime extends AbstractReadKerberosTime
+{
+
+    /**
+     * Instantiates a new StoreCTime action.
+     */
+    public StoreCTime()
+    {
+        super( "Stores the CTime" );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void setKerberosTime( KerberosTime krbtime, Asn1Container container )
+    {
+        AuthenticatorContainer authenticatorContainer = ( AuthenticatorContainer ) container;
+        authenticatorContainer.getAuthenticator().setCTime( krbtime );
+        authenticatorContainer.setGrammarEndAllowed( true );
+    }
+}

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSeqNumber.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSeqNumber.java?rev=1036987&r1=1036986&r2=1036987&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSeqNumber.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSeqNumber.java
Fri Nov 19 19:47:09 2010
@@ -50,5 +50,6 @@ public class StoreSeqNumber extends Abst
     {
         AuthenticatorContainer authenticatorContainer = ( AuthenticatorContainer ) container;
         authenticatorContainer.getAuthenticator().setSeqNumber( value );
+        authenticatorContainer.setGrammarEndAllowed( true );
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSubKey.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSubKey.java?rev=1036987&r1=1036986&r2=1036987&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSubKey.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSubKey.java
Fri Nov 19 19:47:09 2010
@@ -51,5 +51,6 @@ public class StoreSubKey extends Abstrac
     {
         AuthenticatorContainer authenticatorContainer = ( AuthenticatorContainer ) container;
         authenticatorContainer.getAuthenticator().setSubKey( encryptionKey );
+        authenticatorContainer.setGrammarEndAllowed( true );
     }
 }

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=1036987&r1=1036986&r2=1036987&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
Fri Nov 19 19:47:09 2010
@@ -205,7 +205,7 @@ public class Authenticator extends Kerbe
     /**
      * @param ctime the ctime to set
      */
-    public void setCtime( KerberosTime ctime )
+    public void setCTime( KerberosTime ctime )
     {
         this.ctime = ctime;
     }
@@ -343,7 +343,7 @@ public class Authenticator extends Kerbe
         }
 
         // Compute the cusec length
-        cusecLength = 1 + TLV.getNbBytes( cusec ) + cusec;
+        cusecLength = 1 + 1 + Value.getNbBytes( cusec );
 
         // Compute the ctime length
         ctimeLength = 1 + 1 + 0x0F;
@@ -357,7 +357,7 @@ public class Authenticator extends Kerbe
         // Compute the seq-number  length if any
         if ( seqNumber != null )
         {
-            seqNumberLength = 1 + TLV.getNbBytes( seqNumber ) + seqNumber;
+            seqNumberLength = 1 + 1 + Value.getNbBytes( seqNumber );
         }
         
         // Compute the authorization-data length if any

Added: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AuthenticatorDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AuthenticatorDecoderTest.java?rev=1036987&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AuthenticatorDecoderTest.java
(added)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AuthenticatorDecoderTest.java
Fri Nov 19 19:47:09 2010
@@ -0,0 +1,390 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.kerberos.codec;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.nio.ByteBuffer;
+
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.asn1.ber.Asn1Decoder;
+import org.apache.directory.shared.asn1.codec.DecoderException;
+import org.apache.directory.shared.asn1.codec.EncoderException;
+import org.apache.directory.shared.kerberos.codec.authenticator.AuthenticatorContainer;
+import org.apache.directory.shared.kerberos.messages.Authenticator;
+import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * Test the decoder for a Authenticator message
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
+public class AuthenticatorDecoderTest
+{
+    /**
+     * Test the decoding of a Authenticator message
+     */
+    @Test
+    public void testDecodeFullAuthenticator() throws Exception
+    {
+        Asn1Decoder kerberosDecoder = new Asn1Decoder();
+
+        ByteBuffer stream = ByteBuffer.allocate( 0x95 );
+        
+        stream.put( new byte[]
+        {
+          0x62, (byte)0x81, (byte)0x92,
+            0x30, (byte)0x81, (byte)0x8F,
+              (byte)0xA0, 0x03,         // authenticator vno
+                0x02, 0x01, 0x05,
+              (byte)0xA1, 0x0D,         // crealm 
+                0x1B, 0x0B, 
+                  'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M', 
+              (byte)0xA2, 0x13,         // cname
+                0x30, 0x11, 
+                  (byte)0xA0, 0x03, 
+                    0x02, 0x01, 0x0A, 
+                  (byte)0xA1, 0x0A, 
+                    0x30, 0x08, 
+                      0x1B, 0x06, 
+                        'c', 'l', 'i', 'e', 'n', 't',
+              (byte)0xA3, 0x0F,         // cksum
+                0x30, 0x0D,
+                  (byte)0xA0, 0x03,
+                    0x02, 0x01, 0x01,
+                  (byte)0xA1, 0x06,
+                    0x04, 0x04, 'a', 'b', 'c', 'd',
+              (byte)0xA4, 0x03,         // cusec
+                0x02, 0x01, 0x7F, 
+              (byte)0xA5, 0x11,         // ctime 
+                0x18, 0x0F, 
+                  '2', '0', '1', '0', '1', '1', '1', '0', '1', '5', '4', '5', '2', '5', 'Z',
+              (byte)0xA6, 0x0F,         // subkey
+                0x30, 0x0D,
+                  (byte)0xA0, 0x03,
+                    0x02, 0x01, 0x01,
+                  (byte)0xA1, 0x06,
+                    0x04, 0x04, 'A', 'B', 'C', 'D',
+              (byte)0xA7, 0x04,         // seq-number
+                0x02, 0x02, 
+                  0x30, 0x39, 
+              (byte)0xA8, 0x24,         // authorization-data
+                0x30, 0x22,
+                  0x30, 0x0F,
+                    (byte)0xA0, 0x03,                 // ad-type
+                      0x02, 0x01, 0x02,
+                    (byte)0xA1, 0x08,                 // ad-data
+                      0x04, 0x06, 'a', 'b', 'c', 'd', 'e', 'f',
+                  0x30, 0x0F,
+                    (byte)0xA0, 0x03,                 // ad-type
+                      0x02, 0x01, 0x02,
+                    (byte)0xA1, 0x08,                 // ad-data
+                      0x04, 0x06, 'g', 'h', 'i', 'j', 'k', 'l'
+        });
+
+        String decodedPdu = StringTools.dumpBytes( stream.array() );
+        stream.flip();
+
+        // Allocate a Authenticator Container
+        Asn1Container authenticatorContainer = new AuthenticatorContainer();
+        authenticatorContainer.setStream( stream );
+        
+        // Decode the Authenticator PDU
+        try
+        {
+            kerberosDecoder.decode( stream, authenticatorContainer );
+        }
+        catch ( DecoderException de )
+        {
+            fail( de.getMessage() );
+        }
+
+        Authenticator authenticator = ((AuthenticatorContainer)authenticatorContainer).getAuthenticator();
+        
+        // Check the encoding
+        int length = authenticator.computeLength();
+
+        // Check the length
+        assertEquals( 0x95, length );
+        
+        // Check the encoding
+        ByteBuffer encodedPdu = ByteBuffer.allocate( length );
+        
+        try
+        {
+            encodedPdu = authenticator.encode( encodedPdu );
+            
+            System.out.println( StringTools.dumpBytes( encodedPdu.array() ) );
+    
+            // Check the length
+            assertEquals( 0x95, encodedPdu.limit() );
+            assertEquals( decodedPdu, StringTools.dumpBytes( encodedPdu.array() ) );
+        }
+        catch ( EncoderException ee )
+        {
+            fail();
+        }
+    }
+    
+    
+    /**
+     * Test the decoding of a Authenticator with nothing in it
+     */
+    @Test( expected = DecoderException.class)
+    public void testAuthenticatorEmpty() throws DecoderException
+    {
+        Asn1Decoder kerberosDecoder = new Asn1Decoder();
+
+        ByteBuffer stream = ByteBuffer.allocate( 0x02 );
+        
+        stream.put( new byte[]
+            { 0x62, 0x00 } );
+
+        stream.flip();
+
+        // Allocate a Authenticator Container
+        Asn1Container authenticatorContainer = new AuthenticatorContainer();
+
+        // Decode the Authenticator PDU
+        kerberosDecoder.decode( stream, authenticatorContainer );
+        fail();
+    }
+    
+    
+    /**
+     * Test the decoding of a Authenticator with empty sequence
+     */
+    @Test( expected = DecoderException.class)
+    public void testKdcReqBodyEmptySequence() throws DecoderException
+    {
+        Asn1Decoder kerberosDecoder = new Asn1Decoder();
+
+        ByteBuffer stream = ByteBuffer.allocate( 0x04 );
+        
+        stream.put( new byte[]
+            { 
+                0x62, 0x02,
+                  0x30, 0x00
+            } );
+
+        stream.flip();
+
+        // Allocate a Authenticator Container
+        Asn1Container authenticatorContainer = new AuthenticatorContainer();
+
+        // Decode the Authenticator PDU
+        kerberosDecoder.decode( stream, authenticatorContainer );
+        fail();
+    }
+    
+    
+    /**
+     * Test the decoding of a Authenticator with empty authenticator-vno tag
+     */
+    @Test( expected = DecoderException.class)
+    public void testKdcReqBodyEmptyAuthenticatorTag() throws DecoderException
+    {
+        Asn1Decoder kerberosDecoder = new Asn1Decoder();
+
+        ByteBuffer stream = ByteBuffer.allocate( 0x06 );
+        
+        stream.put( new byte[]
+            { 
+                0x62, 0x04,
+                  0x30, 0x02,
+                    (byte)0xA0, 0x00
+            } );
+
+        stream.flip();
+
+        // Allocate a Authenticator Container
+        Asn1Container authenticatorContainer = new AuthenticatorContainer();
+
+        // Decode the Authenticator PDU
+        kerberosDecoder.decode( stream, authenticatorContainer );
+        fail();
+    }
+    
+    
+    /**
+     * Test the decoding of a Authenticator with empty authenticator-vno value
+     */
+    @Test( expected = DecoderException.class)
+    public void testKdcReqBodyEmptyAuthenticatorValue() throws DecoderException
+    {
+        Asn1Decoder kerberosDecoder = new Asn1Decoder();
+
+        ByteBuffer stream = ByteBuffer.allocate( 0x08 );
+        
+        stream.put( new byte[]
+            { 
+                0x62, 0x06,
+                  0x30, 0x04,
+                    (byte)0xA0, 0x02,
+                      0x02, 0x00
+            } );
+
+        stream.flip();
+
+        // Allocate a Authenticator Container
+        Asn1Container authenticatorContainer = new AuthenticatorContainer();
+
+        // Decode the Authenticator PDU
+        kerberosDecoder.decode( stream, authenticatorContainer );
+        fail();
+    }
+    
+    
+    /**
+     * Test the decoding of a Authenticator with no authenticator-vno
+     */
+    @Test( expected = DecoderException.class)
+    public void testKdcReqBodyNoOptions() throws DecoderException
+    {
+        Asn1Decoder kerberosDecoder = new Asn1Decoder();
+
+        ByteBuffer stream = ByteBuffer.allocate( 0x152 );
+        
+        stream.put( new byte[]
+             {
+                 0x30, (byte)0x82, 0x01, 0x4E, 
+                   (byte)0xA1, 0x13, 
+                     0x30, 0x11, 
+                       (byte)0xA0, 0x03, 
+                         0x02, 0x01, 0x0A, 
+                       (byte)0xA1, 0x0A, 
+                         0x30, 0x08, 
+                           0x1B, 0x06, 
+                             'c', 'l', 'i', 'e', 'n', 't', 
+                   (byte)0xA2, 0x0D, 
+                     0x1B, 0x0B, 
+                       'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M', 
+                   (byte)0xA3, 0x13, 
+                     0x30, 0x11, 
+                       (byte)0xA0, 0x03, 
+                         0x02, 0x01, 0x0A, 
+                       (byte)0xA1, 0x0A, 
+                         0x30, 0x08, 
+                           0x1B, 0x06, 
+                             's', 'e', 'r', 'v', 'e', 'r', 
+                   (byte)0xA4, 0x11, 
+                     0x18, 0x0F, 
+                       '2', '0', '1', '0', '1', '1', '1', '0', '1', '5', '4', '5', '2', '5',
'Z', 
+                   (byte)0xA5, 0x11, 
+                     0x18, 0x0F, 
+                       '2', '0', '1', '0', '1', '1', '1', '0', '1', '5', '4', '5', '2', '5',
'Z', 
+                   (byte)0xA6, 0x11, 
+                     0x18, 0x0F, 
+                       '2', '0', '1', '0', '1', '1', '1', '0', '1', '5', '4', '5', '2', '5',
'Z', 
+                   (byte)0xA7, 0x04, 
+                     0x02, 0x02, 
+                       0x30, 0x39, 
+                   (byte)0xA8, 0x0B, 
+                     0x30, 0x09, 
+                       0x02, 0x01, 0x06, 
+                       0x02, 0x01, 0x11, 
+                       0x02, 0x01, 0x12, 
+                   (byte)0xA9, 0x2E, 
+                     0x30, 0x2C, 
+                       0x30, 0x14, 
+                         (byte)0xA0, 0x03, 
+                           0x02, 0x01, 0x02, 
+                         (byte)0xA1, 0x0D, 
+                           0x04, 0x0B, 
+                             '1', '9', '2', '.', '1', '6', '8', '.', '0', '.', '1', 
+                       0x30, 0x14, 
+                         (byte)0xA0, 0x03, 
+                           0x02, 0x01, 0x02, 
+                         (byte)0xA1, 0x0D, 
+                           0x04, 0x0B, 
+                             '1', '9', '2', '.', '1', '6', '8', '.', '0', '.', '2', 
+                   (byte)0xAA, 0x11, 
+                     0x30, 0x0F, 
+                       (byte)0xA0, 0x03, 
+                         0x02, 0x01, 0x11, 
+                       (byte)0xA2, 0x08, 
+                         0x04, 0x06, 
+                           'a', 'b', 'c', 'd', 'e', 'f', 
+                   (byte)0xAB, (byte)0x81, (byte)0x83, 
+                     0x30, (byte)0x81, (byte)0x80, 
+                       0x61, 0x3E, 
+                         0x30, 0x3C, 
+                           (byte)0xA0, 0x03, 
+                             0x02, 0x01, 0x05, 
+                           (byte)0xA1, 0x0D, 
+                             0x1B, 0x0B, 
+                               'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M', 
+                           (byte)0xA2, 0x13, 
+                             0x30, 0x11, 
+                               (byte)0xA0, 0x03, 
+                                 0x02, 0x01, 0x01, 
+                               (byte)0xA1, 0x0A, 
+                                 0x30, 0x08, 
+                                   0x1B, 0x06, 
+                                     'c', 'l', 'i', 'e', 'n', 't', 
+                           (byte)0xA3, 0x11, 
+                             0x30, 0x0F, 
+                               (byte)0xA0, 0x03, 
+                                 0x02, 0x01, 0x11, 
+                               (byte)0xA2, 0x08, 
+                                 0x04, 0x06, 
+                                   'a', 'b', 'c', 'd', 'e', 'f', 
+                       0x61, 0x3E, 
+                         0x30, 0x3C, 
+                           (byte)0xA0, 0x03, 
+                             0x02, 0x01, 0x05, 
+                           (byte)0xA1, 0x0D, 
+                             0x1B, 0x0B, 
+                               'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M',
+                           (byte)0xA2, 0x13, 
+                             0x30, 0x11, 
+                               (byte)0xA0, 0x03, 
+                                 0x02, 0x01, 0x01, 
+                               (byte)0xA1, 0x0A, 
+                                 0x30, 0x08, 
+                                   0x1B, 0x06, 
+                                     's', 'e', 'r', 'v', 'e', 'r', 
+                           (byte)0xA3, 0x11, 
+                             0x30, 0x0F, 
+                               (byte)0xA0, 0x03, 
+                                 0x02, 0x01, 0x11, 
+                               (byte)0xA2, 0x08, 
+                                 0x04, 0x06, 
+                                   'a', 'b', 'c', 'd', 'e', 'f'
+             });
+
+        stream.flip();
+
+        // Allocate a Authenticator Container
+        Asn1Container authenticatorContainer = new AuthenticatorContainer();
+
+        // Decode the Authenticator PDU
+        kerberosDecoder.decode( stream, authenticatorContainer );
+        fail();
+    }
+}



Mime
View raw message