directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1034771 - in /directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket: ./ actions/
Date Sat, 13 Nov 2010 14:44:03 GMT
Author: elecharny
Date: Sat Nov 13 14:44:03 2010
New Revision: 1034771

URL: http://svn.apache.org/viewvc?rev=1034771&view=rev
Log:
Created a separate package for the Ticket decoding

Added:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketContainer.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketGrammar.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketStatesEnum.java
Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketEncPart.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketInit.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketRealm.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketSName.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketTktVno.java

Added: 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=1034771&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketContainer.java
(added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketContainer.java
Sat Nov 13 14:44:03 2010
@@ -0,0 +1,70 @@
+/*
+ *  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.ticket;
+
+import org.apache.directory.shared.asn1.ber.AbstractContainer;
+import org.apache.directory.shared.kerberos.messages.Ticket;
+
+
+/**
+ * The Ticket container stores the ticket decoded by the Asn1Decoder.
+ * When dealing with an incoding PDU, we will obtain a KerberosMessage in the
+ * container.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TicketContainer extends AbstractContainer
+{
+    /** The ticket */
+    private Ticket ticket;
+    
+    /**
+     * Creates a new TicketContainer object. We will store one grammars,
+     * it's enough ...
+     */
+    public TicketContainer()
+    {
+        super();
+        this.stateStack = new int[10];
+        this.grammar = TicketGrammar.getInstance();
+        setTransition( TicketStatesEnum.START_STATE );
+    }
+
+
+    /**
+     * @return Returns the Ticket.
+     */
+    public Ticket getTicket()
+    {
+        return ticket;
+    }
+
+    
+    /**
+     * Set a Ticket into the container. It will be completed by the
+     * KerberosDecoder.
+     * 
+     * @param ticket The ticket to set.
+     */
+    public void setTicket( Ticket ticket )
+    {
+        this.ticket = ticket;
+    }
+}

Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketGrammar.java?rev=1034771&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketGrammar.java
(added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketGrammar.java
Sat Nov 13 14:44:03 2010
@@ -0,0 +1,178 @@
+/*
+ *  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.ticket;
+
+
+import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
+import org.apache.directory.shared.asn1.ber.grammar.Grammar;
+import org.apache.directory.shared.asn1.ber.grammar.GrammarTransition;
+import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
+import org.apache.directory.shared.kerberos.KerberosConstants;
+import org.apache.directory.shared.kerberos.codec.actions.CheckNotNullLength;
+import org.apache.directory.shared.kerberos.codec.ticket.actions.TicketEncPart;
+import org.apache.directory.shared.kerberos.codec.ticket.actions.TicketInit;
+import org.apache.directory.shared.kerberos.codec.ticket.actions.TicketRealm;
+import org.apache.directory.shared.kerberos.codec.ticket.actions.TicketSName;
+import org.apache.directory.shared.kerberos.codec.ticket.actions.TicketTktVno;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * This class implements the Ticket message. All the actions are declared
+ * in this class. As it is a singleton, these declaration are only done once. If
+ * an action is to be added or modified, this is where the work is to be done !
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public final class TicketGrammar extends AbstractGrammar
+{
+    /** The logger */
+    static final Logger LOG = LoggerFactory.getLogger( TicketGrammar.class );
+
+    /** A speedup for logger */
+    static final boolean IS_DEBUG = LOG.isDebugEnabled();
+
+    /** The instance of grammar. TicketGrammar is a singleton */
+    private static Grammar instance = new TicketGrammar();
+
+
+    /**
+     * Creates a new TicketGrammar object.
+     */
+    private TicketGrammar()
+    {
+        setName( TicketGrammar.class.getName() );
+
+        // Create the transitions table
+        super.transitions = new GrammarTransition[TicketStatesEnum.LAST_TICKET_STATE.ordinal()][256];
+
+        // ============================================================================================
+        // Ticket 
+        // ============================================================================================
+        // --------------------------------------------------------------------------------------------
+        // Transition from START to Ticket
+        // --------------------------------------------------------------------------------------------
+        // This is the starting state :
+        // Ticket          ::= [APPLICATION 1] ... 
+        super.transitions[TicketStatesEnum.START_STATE.ordinal()][KerberosConstants.TICKET_TAG]
= new GrammarTransition(
+            TicketStatesEnum.START_STATE, TicketStatesEnum.TICKET_STATE, KerberosConstants.TICKET_TAG,
+            new TicketInit() );
+
+        
+        // --------------------------------------------------------------------------------------------
+        // Transition from Ticket to Ticket-SEQ
+        // --------------------------------------------------------------------------------------------
+        // Ticket          ::= [APPLICATION 1] SEQUENCE { 
+        super.transitions[TicketStatesEnum.TICKET_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()]
= new GrammarTransition(
+            TicketStatesEnum.TICKET_STATE, TicketStatesEnum.TICKET_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
+            new CheckNotNullLength() );
+
+        
+        // --------------------------------------------------------------------------------------------
+        // Transition from Ticket-SEQ to tkt-vno tag
+        // --------------------------------------------------------------------------------------------
+        // Ticket          ::= [APPLICATION 1] SEQUENCE { 
+        //         tkt-vno         [0] 
+        super.transitions[TicketStatesEnum.TICKET_SEQ_STATE.ordinal()][KerberosConstants.TICKET_TKT_VNO_TAG]
= new GrammarTransition(
+            TicketStatesEnum.TICKET_SEQ_STATE, TicketStatesEnum.TICKET_VNO_TAG_STATE, KerberosConstants.TICKET_TKT_VNO_TAG,
+            new CheckNotNullLength() );
+
+        
+        // --------------------------------------------------------------------------------------------
+        // Transition from tkt-vno tag to tkt-vno 
+        // --------------------------------------------------------------------------------------------
+        // Ticket          ::= [APPLICATION 1] SEQUENCE { 
+        //         tkt-vno         [0] INTEGER (5),
+        super.transitions[TicketStatesEnum.TICKET_VNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()]
= new GrammarTransition(
+            TicketStatesEnum.TICKET_VNO_TAG_STATE, TicketStatesEnum.TICKET_VNO_STATE, UniversalTag.INTEGER.getValue(),
+            new TicketTktVno() );
+
+        
+        // --------------------------------------------------------------------------------------------
+        // Transition from tkt-vno to realm tag
+        // --------------------------------------------------------------------------------------------
+        // Ticket          ::= [APPLICATION 1] SEQUENCE { 
+        //         tkt-vno         [0] INTEGER (5), 
+        //         realm           [1]
+        super.transitions[TicketStatesEnum.TICKET_VNO_STATE.ordinal()][KerberosConstants.TICKET_REALM_TAG]
= new GrammarTransition(
+            TicketStatesEnum.TICKET_VNO_STATE, TicketStatesEnum.TICKET_REALM_TAG_STATE, KerberosConstants.TICKET_REALM_TAG,
+            new CheckNotNullLength() );
+
+        
+        // --------------------------------------------------------------------------------------------
+        // Transition from realm tag to realm value
+        // --------------------------------------------------------------------------------------------
+        // Ticket          ::= [APPLICATION 1] SEQUENCE { 
+        //         tkt-vno         [0] INTEGER (5),
+        //         realm           [1] Realm,
+        super.transitions[TicketStatesEnum.TICKET_REALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()]
= new GrammarTransition(
+            TicketStatesEnum.TICKET_REALM_TAG_STATE, TicketStatesEnum.TICKET_REALM_STATE,
UniversalTag.GENERAL_STRING.getValue(),
+            new TicketRealm() );
+
+        
+        // --------------------------------------------------------------------------------------------
+        // Transition from realm value to sname tag
+        // --------------------------------------------------------------------------------------------
+        // Ticket          ::= [APPLICATION 1] SEQUENCE { 
+        //         tkt-vno         [0] INTEGER (5),
+        //         realm           [1] Realm,
+        //         sname           [2] 
+        super.transitions[TicketStatesEnum.TICKET_REALM_STATE.ordinal()][KerberosConstants.TICKET_SNAME_TAG]
= new GrammarTransition(
+            TicketStatesEnum.TICKET_REALM_STATE, TicketStatesEnum.TICKET_SNAME_TAG_STATE,
KerberosConstants.TICKET_SNAME_TAG,
+            new TicketSName() );
+
+
+        // --------------------------------------------------------------------------------------------
+        // Transition from sname tag to enc-part tag
+        // --------------------------------------------------------------------------------------------
+        // Ticket          ::= [APPLICATION 1] SEQUENCE { 
+        //         ...
+        //         sname           [2] PrincipalName,
+        //         enc-part        [3]
+        // 
+        super.transitions[TicketStatesEnum.TICKET_SNAME_TAG_STATE.ordinal()][KerberosConstants.TICKET_ENC_PART_TAG]
= new GrammarTransition(
+            TicketStatesEnum.TICKET_SNAME_TAG_STATE, TicketStatesEnum.TICKET_ENC_PART_TAG_STATE,
KerberosConstants.TICKET_ENC_PART_TAG,
+            new CheckNotNullLength() );
+
+        
+        // --------------------------------------------------------------------------------------------
+        // Transition from enc-part tag to enc-part value
+        // --------------------------------------------------------------------------------------------
+        // Ticket          ::= [APPLICATION 1] SEQUENCE { 
+        //         ...
+        //         enc-part        [3] EncryptedData
+        // 
+        super.transitions[TicketStatesEnum.TICKET_SNAME_TAG_STATE.ordinal()][KerberosConstants.TICKET_ENC_PART_TAG]
= new GrammarTransition(
+            TicketStatesEnum.TICKET_SNAME_TAG_STATE, TicketStatesEnum.TICKET_ENC_PART_TAG_STATE,
KerberosConstants.TICKET_ENC_PART_TAG,
+            new TicketEncPart() );
+    }
+
+
+    /**
+     * Get the instance of this grammar
+     * 
+     * @return An instance on the Ticket Grammar
+     */
+    public static Grammar getInstance()
+    {
+        return instance;
+    }
+}

Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketStatesEnum.java?rev=1034771&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketStatesEnum.java
(added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/TicketStatesEnum.java
Sat Nov 13 14:44:03 2010
@@ -0,0 +1,116 @@
+/*
+ *  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.ticket;
+
+
+import org.apache.directory.shared.asn1.ber.grammar.Grammar;
+import org.apache.directory.shared.asn1.ber.grammar.States;
+import org.apache.directory.shared.kerberos.codec.KerberosMessageGrammar;
+
+
+/**
+ * This class store the Ticket grammar's constants. It is also used for debugging
+ * purpose
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public enum TicketStatesEnum implements States
+{
+    // Start
+    START_STATE,
+    
+    // ----- Ticket message --------------------------------------------
+    TICKET_STATE,
+    TICKET_SEQ_STATE,
+    
+    TICKET_VNO_TAG_STATE,
+    TICKET_VNO_STATE,
+    
+    TICKET_REALM_TAG_STATE,
+    TICKET_REALM_STATE,
+    
+    TICKET_SNAME_TAG_STATE,
+
+    TICKET_ENC_PART_TAG_STATE,
+    
+    // End
+    LAST_TICKET_STATE;
+
+    
+    /**
+     * Get the grammar name
+     * 
+     * @param grammar The grammar code
+     * @return The grammar name
+     */
+    public String getGrammarName( int grammar )
+    {
+        return "TICKET_GRAMMAR";
+    }
+
+
+    /**
+     * Get the grammar name
+     * 
+     * @param grammar The grammar class
+     * @return The grammar name
+     */
+    public String getGrammarName( Grammar grammar )
+    {
+        if ( grammar instanceof KerberosMessageGrammar )
+        {
+            return "TICKET_GRAMMAR";
+        }
+        else
+        {
+            return "UNKNOWN GRAMMAR";
+        }
+    }
+
+
+    /**
+     * Get the string representing the state
+     * 
+     * @param state The state number
+     * @return The String representing the state
+     */
+    public String getState( int state )
+    {
+        return ( ( state == LAST_TICKET_STATE.ordinal() ) ? "TICKET_END_STATE" : name() );
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEndState()
+    {
+        return this == LAST_TICKET_STATE;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public TicketStatesEnum getStartState()
+    {
+        return START_STATE;
+    }
+}

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketEncPart.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketEncPart.java?rev=1034771&r1=1034770&r2=1034771&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketEncPart.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketEncPart.java
Sat Nov 13 14:44:03 2010
@@ -26,9 +26,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.kerberos.codec.KerberosMessageContainer;
 import org.apache.directory.shared.kerberos.codec.KerberosMessageGrammar;
 import org.apache.directory.shared.kerberos.codec.encryptedData.EncryptedDataContainer;
+import org.apache.directory.shared.kerberos.codec.ticket.TicketContainer;
 import org.apache.directory.shared.kerberos.components.EncryptedData;
 import org.apache.directory.shared.kerberos.messages.Ticket;
 import org.slf4j.Logger;
@@ -63,9 +63,9 @@ public class TicketEncPart extends Gramm
      */
     public void action( Asn1Container container ) throws DecoderException
     {
-        KerberosMessageContainer kerberosMessageContainer = ( KerberosMessageContainer )
container;
+        TicketContainer ticketContainer = ( TicketContainer ) container;
 
-        TLV tlv = kerberosMessageContainer.getCurrentTLV();
+        TLV tlv = ticketContainer.getCurrentTLV();
 
         // The Length should not be null
         if ( tlv.getLength() == 0 )
@@ -92,7 +92,7 @@ public class TicketEncPart extends Gramm
         }
 
         EncryptedData encryptedData = encryptedDataContainer.getEncryptedData();
-        Ticket ticket = (Ticket)kerberosMessageContainer.getMessage();
+        Ticket ticket = ticketContainer.getTicket();
         ticket.setEncPart( encryptedData );
 
         if ( IS_DEBUG )

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketInit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketInit.java?rev=1034771&r1=1034770&r2=1034771&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketInit.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketInit.java
Sat Nov 13 14:44:03 2010
@@ -25,8 +25,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.kerberos.codec.KerberosMessageContainer;
 import org.apache.directory.shared.kerberos.codec.KerberosMessageGrammar;
+import org.apache.directory.shared.kerberos.codec.ticket.TicketContainer;
 import org.apache.directory.shared.kerberos.messages.Ticket;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -51,7 +51,7 @@ public class TicketInit extends GrammarA
      */
     public TicketInit()
     {
-        super( "Kerberos Ticket initialization" );
+        super( "Ticket initialization" );
     }
 
 
@@ -60,9 +60,9 @@ public class TicketInit extends GrammarA
      */
     public void action( Asn1Container container ) throws DecoderException
     {
-        KerberosMessageContainer kerberosMessageContainer = ( KerberosMessageContainer )
container;
+        TicketContainer ticketContainer = ( TicketContainer ) container;
 
-        TLV tlv = kerberosMessageContainer.getCurrentTLV();
+        TLV tlv = ticketContainer.getCurrentTLV();
 
         // The Length should not be null
         if ( tlv.getLength() == 0 )
@@ -76,6 +76,6 @@ public class TicketInit extends GrammarA
         // Create the Ticket now
         Ticket ticket = new Ticket();
         
-        kerberosMessageContainer.setMessage( ticket );
+        ticketContainer.setTicket( ticket );
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketRealm.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketRealm.java?rev=1034771&r1=1034770&r2=1034771&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketRealm.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketRealm.java
Sat Nov 13 14:44:03 2010
@@ -26,8 +26,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.kerberos.codec.KerberosMessageContainer;
 import org.apache.directory.shared.kerberos.codec.KerberosMessageGrammar;
+import org.apache.directory.shared.kerberos.codec.ticket.TicketContainer;
 import org.apache.directory.shared.kerberos.messages.Ticket;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -62,9 +62,9 @@ public class TicketRealm extends Grammar
      */
     public void action( Asn1Container container ) throws DecoderException
     {
-        KerberosMessageContainer kerberosMessageContainer = ( KerberosMessageContainer )
container;
+        TicketContainer ticketContainer = ( TicketContainer ) container;
 
-        TLV tlv = kerberosMessageContainer.getCurrentTLV();
+        TLV tlv = ticketContainer.getCurrentTLV();
 
         // The Length should not be null
         if ( tlv.getLength() == 0 )
@@ -78,7 +78,7 @@ public class TicketRealm extends Grammar
         // The value is the realm
         Value value = tlv.getValue();
         String realm = StringTools.utf8ToString( value.getData() );
-        Ticket ticket = kerberosMessageContainer.getTicket();
+        Ticket ticket = ticketContainer.getTicket();
 
         ticket.setRealm( realm );
         

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketSName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketSName.java?rev=1034771&r1=1034770&r2=1034771&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketSName.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketSName.java
Sat Nov 13 14:44:03 2010
@@ -26,9 +26,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.kerberos.codec.KerberosMessageContainer;
 import org.apache.directory.shared.kerberos.codec.KerberosMessageGrammar;
 import org.apache.directory.shared.kerberos.codec.principalName.PrincipalNameContainer;
+import org.apache.directory.shared.kerberos.codec.ticket.TicketContainer;
 import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.kerberos.messages.Ticket;
 import org.slf4j.Logger;
@@ -63,9 +63,9 @@ public class TicketSName extends Grammar
      */
     public void action( Asn1Container container ) throws DecoderException
     {
-        KerberosMessageContainer kerberosMessageContainer = ( KerberosMessageContainer )
container;
+        TicketContainer ticketContainer = ( TicketContainer ) container;
 
-        TLV tlv = kerberosMessageContainer.getCurrentTLV();
+        TLV tlv = ticketContainer.getCurrentTLV();
 
         // The Length should not be null
         if ( tlv.getLength() == 0 )
@@ -93,7 +93,7 @@ public class TicketSName extends Grammar
 
         // Store the Principal name in the Ticket
         PrincipalName principalName = principalNameContainer.getPrincipalName();
-        Ticket ticket = kerberosMessageContainer.getTicket();
+        Ticket ticket = ticketContainer.getTicket();
         ticket.setSName( principalName );
         
         // Update the parent
@@ -101,7 +101,7 @@ public class TicketSName extends Grammar
 
         if ( IS_DEBUG )
         {
-            LOG.debug( "PrincipalName : " + kerberosMessageContainer );
+            LOG.debug( "PrincipalName : " + principalName );
         }
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketTktVno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketTktVno.java?rev=1034771&r1=1034770&r2=1034771&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketTktVno.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/TicketTktVno.java
Sat Nov 13 14:44:03 2010
@@ -28,8 +28,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.util.IntegerDecoder;
 import org.apache.directory.shared.asn1.util.IntegerDecoderException;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.kerberos.codec.KerberosMessageContainer;
 import org.apache.directory.shared.kerberos.codec.KerberosMessageGrammar;
+import org.apache.directory.shared.kerberos.codec.ticket.TicketContainer;
 import org.apache.directory.shared.kerberos.messages.Ticket;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -64,9 +64,9 @@ public class TicketTktVno extends Gramma
      */
     public void action( Asn1Container container ) throws DecoderException
     {
-        KerberosMessageContainer kerberosMessageContainer = ( KerberosMessageContainer )
container;
+        TicketContainer ticketContainer = ( TicketContainer ) container;
 
-        TLV tlv = kerberosMessageContainer.getCurrentTLV();
+        TLV tlv = ticketContainer.getCurrentTLV();
 
         // The Length should not be null
         if ( tlv.getLength() == 0 )
@@ -79,7 +79,7 @@ public class TicketTktVno extends Gramma
         
         // The value should be an integer an equal to 5
         Value value = tlv.getValue();
-        Ticket ticket = kerberosMessageContainer.getTicket();
+        Ticket ticket = ticketContainer.getTicket();
 
         try
         {



Mime
View raw message