directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r165223 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java
Date Thu, 28 Apr 2005 23:03:55 GMT
Author: elecharny
Date: Thu Apr 28 16:03:55 2005
New Revision: 165223

URL: http://svn.apache.org/viewcvs?rev=165223&view=rev
Log:
Added the missing transition in the SPNEGO grammar for the NegTokenInit part.
The NegTokenTarg part is still to be added. 
Actions are to be completed.

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java?rev=165223&r1=165222&r2=165223&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java
Thu Apr 28 16:03:55 2005
@@ -171,10 +171,11 @@
             new GrammarTransition( SpnegoStatesEnum.SPNEGO_NEG_TOKEN_INIT_SEQUENCE_VALUE,
                 SpnegoStatesEnum.SPNEGO_NEG_TOKEN_INIT_SEQUENCE_FOLLOWING_TAG, null );
 
+        //------------------------------------------------------------------------------------------
         // NegTokenInit ::= SEQUENCE {
         //    mechTypes     [0]  MechTypeList  OPTIONAL, (Tag)
         //    ...
-        // We have a 0xA0 tag, so this is a mechTypes. We have to check the length
+        // We have a 0xA0 tag, so this is a mechTypes.
         super.transitions[SpnegoStatesEnum.SPNEGO_NEG_TOKEN_INIT_SEQUENCE_FOLLOWING_TAG][0xA0]
=
             new GrammarTransition( SpnegoStatesEnum.SPNEGO_NEG_TOKEN_INIT_SEQUENCE_FOLLOWING_TAG,
                 SpnegoStatesEnum.SPNEGO_MECH_TYPES_LENGTH, null );
@@ -187,12 +188,22 @@
         // in the Spnego object
         super.transitions[SpnegoStatesEnum.SPNEGO_MECH_TYPES_LENGTH][0xA0] =
             new GrammarTransition( SpnegoStatesEnum.SPNEGO_MECH_TYPES_LENGTH,
-                SpnegoStatesEnum.SPNEGO_MECH_TYPES_VALUE, null );
+                SpnegoStatesEnum.SPNEGO_MECH_TYPES_VALUE, 
+                new GrammarAction( "Mech Type list sequence Length" )
+                {
+                    public void action( IAsn1Container container ) throws DecoderException
+                    {
+                        /*SpnegoContainer spnegoContainer = ( SpnegoContainer ) container;
+                        SpnegoPOJO      spnego          = spnegoContainer.getSpnego();
+                        checkLength( spnego, spnegoContainer.getCurrentTLV() );*/
+                        return;
+                    }
+                } );
 
         // NegTokenInit ::= SEQUENCE {
         //    mechTypes     [0]  MechTypeList  OPTIONAL, (Value)
         //    ...
-        // We have nothing to do.
+        // 
         super.transitions[SpnegoStatesEnum.SPNEGO_MECH_TYPES_VALUE][0xA0]       = new GrammarTransition(
                 SpnegoStatesEnum.SPNEGO_MECH_TYPES_VALUE,
                 SpnegoStatesEnum.SPNEGO_MECH_TYPES_LIST_TAG, null );
@@ -234,6 +245,7 @@
                 SpnegoStatesEnum.SPNEGO_MECH_TYPE_FOLLOWING_TAG, SpnegoStatesEnum.SPNEGO_MECH_TYPE_LENGTH,
                 null );
 
+        //------------------------------------------------------------------------------------------
         // NegTokenInit ::= SEQUENCE {
         //    ...
         //    reqFlags      [1]  ContextFlags  OPTIONAL, (Tag)
@@ -255,7 +267,7 @@
         //    ...
         //    reqFlags      [1]  ContextFlags  OPTIONAL, (Length)
         //    ...
-        super.transitions[SpnegoStatesEnum.SPNEGO_REQ_FLAGS_LENGTH][0x03] = new GrammarTransition(
+        super.transitions[SpnegoStatesEnum.SPNEGO_REQ_FLAGS_LENGTH][0xA1] = new GrammarTransition(
                 SpnegoStatesEnum.SPNEGO_REQ_FLAGS_LENGTH, SpnegoStatesEnum.SPNEGO_REQ_FLAGS_VALUE,
                 null );
 
@@ -264,10 +276,53 @@
         //    reqFlags      [1]  ContextFlags  OPTIONAL, (Value)
         //    ...
         // The next state will be the MechToken following
-        super.transitions[SpnegoStatesEnum.SPNEGO_REQ_FLAGS_VALUE][0x03] = new GrammarTransition(
-                SpnegoStatesEnum.SPNEGO_REQ_FLAGS_VALUE, SpnegoStatesEnum.SPNEGO_REQ_FLAGS_FOLLOWING_TAG,
+        super.transitions[SpnegoStatesEnum.SPNEGO_REQ_FLAGS_VALUE][0xA1] = new GrammarTransition(
+                SpnegoStatesEnum.SPNEGO_REQ_FLAGS_VALUE, SpnegoStatesEnum.SPNEGO_CONTEXT_FLAGS_TAG,
                 null );
 
+        // ContextFlags ::= BIT_STRING { (Tag)
+        //     delegFlag     (0),
+        //     mutualFlag    (1),
+        //     replayFlag    (2),
+        //     sequenceFlag  (3),
+        //     anonFlag      (4),
+        //     confFlag      (5),
+        //     integFlag     (6)
+        // }
+        // The next state will be the MechToken following
+        super.transitions[SpnegoStatesEnum.SPNEGO_CONTEXT_FLAGS_TAG][0x03] = new GrammarTransition(
+                SpnegoStatesEnum.SPNEGO_CONTEXT_FLAGS_TAG, SpnegoStatesEnum.SPNEGO_CONTEXT_FLAGS_LENGTH,
+                null );
+
+        // ContextFlags ::= BIT_STRING { (Length)
+        //     delegFlag     (0),
+        //     mutualFlag    (1),
+        //     replayFlag    (2),
+        //     sequenceFlag  (3),
+        //     anonFlag      (4),
+        //     confFlag      (5),
+        //     integFlag     (6)
+        // }
+        // The next state will be the MechToken following
+        super.transitions[SpnegoStatesEnum.SPNEGO_CONTEXT_FLAGS_LENGTH][0x03] = new GrammarTransition(
+                SpnegoStatesEnum.SPNEGO_CONTEXT_FLAGS_LENGTH, SpnegoStatesEnum.SPNEGO_CONTEXT_FLAGS_VALUE,
+                null );
+
+        // ContextFlags ::= BIT_STRING { (value)
+        //     delegFlag     (0),
+        //     mutualFlag    (1),
+        //     replayFlag    (2),
+        //     sequenceFlag  (3),
+        //     anonFlag      (4),
+        //     confFlag      (5),
+        //     integFlag     (6)
+        // }
+        // The next state will be the MechToken following
+        super.transitions[SpnegoStatesEnum.SPNEGO_CONTEXT_FLAGS_VALUE][0x03] = new GrammarTransition(
+                SpnegoStatesEnum.SPNEGO_CONTEXT_FLAGS_VALUE, SpnegoStatesEnum.SPNEGO_REQ_FLAGS_FOLLOWING_TAG,
+                null );
+
+        //------------------------------------------------------------------------------------------
         // NegTokenInit ::= SEQUENCE { (Length)
         //    ...
         //    mechToken     [2]  OCTET STRING  OPTIONAL,
@@ -284,7 +339,7 @@
             new GrammarTransition( SpnegoStatesEnum.SPNEGO_MECH_TYPE_FOLLOWING_TAG,
                 SpnegoStatesEnum.SPNEGO_MECH_TOKEN_LENGTH, null );
 
-        // NegTokenInit ::= SEQUENCE { (Length)
+        // NegTokenInit ::= SEQUENCE {
         //    ...
         //    mechToken     [2]  OCTET STRING  OPTIONAL,
         //    ...
@@ -318,15 +373,60 @@
         // mechToken     [2]  OCTET STRING  OPTIONAL, (Value)
         super.transitions[SpnegoStatesEnum.SPNEGO_MECH_TOKEN_OCTET_STRING_VALUE][0x04]  =
new GrammarTransition(
                 SpnegoStatesEnum.SPNEGO_MECH_TOKEN_OCTET_STRING_VALUE,
-                -1, null );
-
+                SpnegoStatesEnum.SPNEGO_METH_TOKEN_FOLLOWING_TAG, null );
 
+        //------------------------------------------------------------------------------------------
         // NegTokenInit ::= SEQUENCE {
         //    ...
-        //    mechListMIC   [3]  OCTET STRING  OPTIONAL } (Length)
+        //    mechListMIC   [3]  OCTET STRING  OPTIONAL } (Tag)
         super.transitions[SpnegoStatesEnum.SPNEGO_NEG_TOKEN_INIT_SEQUENCE_FOLLOWING_TAG][0xA3]
=
             new GrammarTransition( SpnegoStatesEnum.SPNEGO_NEG_TOKEN_INIT_SEQUENCE_FOLLOWING_TAG,
                 SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_LENGTH, null );
+
+        //    mechListMIC   [3]  OCTET STRING  OPTIONAL } (Tag)
+        super.transitions[SpnegoStatesEnum.SPNEGO_MECH_TYPE_FOLLOWING_TAG][0xA3] =
+            new GrammarTransition( SpnegoStatesEnum.SPNEGO_MECH_TYPE_FOLLOWING_TAG,
+                SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_LENGTH, null );
+
+        //    mechListMIC   [3]  OCTET STRING  OPTIONAL } (Tag)
+        super.transitions[SpnegoStatesEnum.SPNEGO_REQ_FLAGS_FOLLOWING_TAG][0xA3] =
+            new GrammarTransition( SpnegoStatesEnum.SPNEGO_REQ_FLAGS_FOLLOWING_TAG,
+                SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_LENGTH, null );
+
+        //    mechListMIC   [3]  OCTET STRING  OPTIONAL } (Tag)
+        super.transitions[SpnegoStatesEnum.SPNEGO_METH_TOKEN_FOLLOWING_TAG][0xA3] =
+            new GrammarTransition( SpnegoStatesEnum.SPNEGO_METH_TOKEN_FOLLOWING_TAG,
+                SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_LENGTH, null );
+
+        // NegTokenInit ::= SEQUENCE {
+        //    ...
+        //    mechListMIC   [3]  OCTET STRING  OPTIONAL } (Length)
+        super.transitions[SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_LENGTH][0xA3] =
+            new GrammarTransition( SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_LENGTH,
+                SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_VALUE, null );
+
+        // NegTokenInit ::= SEQUENCE {
+        //    ...
+        //    mechListMIC   [3]  OCTET STRING  OPTIONAL } (Value)
+        super.transitions[SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_VALUE][0xA3] =
+            new GrammarTransition( SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_VALUE,
+                SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_OCTET_STRING_TAG, null );
+
+        // mechListMIC   [3]  OCTET STRING  OPTIONAL } (Tag)
+        super.transitions[SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_OCTET_STRING_TAG][0x04] =
new GrammarTransition(
+                SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_OCTET_STRING_TAG, SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_OCTET_STRING_LENGTH,
+                null );
+
+        // mechListMIC   [3]  OCTET STRING  OPTIONAL } (Length)
+        super.transitions[SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_OCTET_STRING_LENGTH][0x04]
= new GrammarTransition(
+                SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_OCTET_STRING_LENGTH, SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_OCTET_STRING_VALUE,
+                null );
+
+        // mechListMIC   [3]  OCTET STRING  OPTIONAL } (Value)
+        super.transitions[SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_OCTET_STRING_VALUE][0x04]
 = new GrammarTransition(
+                SpnegoStatesEnum.SPNEGO_MECH_LIST_MIC_OCTET_STRING_VALUE,
+                -1, null );
+
     }
 
     //~ Methods ------------------------------------------------------------------------------------



Mime
View raw message