directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1039057 - in /directory/apacheds/trunk/kerberos-codec/src: main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/KrbCredInfoGrammar.java test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java
Date Thu, 25 Nov 2010 14:22:10 GMT
Author: kayyagari
Date: Thu Nov 25 14:22:10 2010
New Revision: 1039057

URL: http://svn.apache.org/viewvc?rev=1039057&view=rev
Log:
o added tests for KrbCredInfo
o fixed grammar

Added:
    directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java
Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/KrbCredInfoGrammar.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/KrbCredInfoGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/KrbCredInfoGrammar.java?rev=1039057&r1=1039056&r2=1039057&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/KrbCredInfoGrammar.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/KrbCredInfoGrammar.java
Thu Nov 25 14:22:10 2010
@@ -83,72 +83,72 @@ public final class KrbCredInfoGrammar ex
             KrbCredInfoStatesEnum.KRB_CRED_INFO_SEQ_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_KEY_TAG,
             new StoreKey());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_TAG_STATE,
UniversalTag.GENERALIZED_TIME.getValue(),
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_PREALM_TAG]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_PREALM_TAG,
             new CheckNotNullLength());
         
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_TAG_STATE,
UniversalTag.GENERAL_STRING.getValue(),
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE,
UniversalTag.GENERAL_STRING.getValue(),
             new StorePRealm());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_PNAME_TAG]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE,
KerberosConstants.KRB_CRED_INFO_PNAME_TAG,
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_PNAME_TAG]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_PNAME_TAG,
             new StorePName());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_FLAGS_TAG]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE
, KerberosConstants.KRB_CRED_INFO_FLAGS_TAG,
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_FLAGS_TAG]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_TAG_STATE
, KerberosConstants.KRB_CRED_INFO_FLAGS_TAG,
             new CheckNotNullLength());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE .ordinal()][UniversalTag.INTEGER.getValue()]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE , KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_TAG_STATE,
UniversalTag.INTEGER.getValue(),
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_TAG_STATE .ordinal()][UniversalTag.INTEGER.getValue()]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_TAG_STATE , KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE,
UniversalTag.INTEGER.getValue(),
             new StoreFlags());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE,
KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG,
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG,
             new CheckNotNullLength());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_TAG_STATE
 , UniversalTag.GENERALIZED_TIME.getValue(),
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_TAG_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE
 , UniversalTag.GENERALIZED_TIME.getValue(),
             new StoreAuthTime());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_TAG_STATE  .ordinal()][KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_TAG_STATE  , KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE,
KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG,
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE  .ordinal()][KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE  , KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG,
             new CheckNotNullLength());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_TAG_STATE
, UniversalTag.GENERALIZED_TIME.getValue(),
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_TAG_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE
, UniversalTag.GENERALIZED_TIME.getValue(),
             new StoreStartTime());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_TAG_STATE .ordinal()][KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_TAG_STATE , KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE .ordinal()][KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE , KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
             new CheckNotNullLength());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE,
UniversalTag.GENERALIZED_TIME.getValue(),
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE,
UniversalTag.GENERALIZED_TIME.getValue(),
             new StoreEndTime());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
             new CheckNotNullLength());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE
 , UniversalTag.GENERALIZED_TIME.getValue(),
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE
 , UniversalTag.GENERALIZED_TIME.getValue(),
             new StoreRenewtill());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE  .ordinal()][KerberosConstants.KRB_CRED_INFO_SREALM_TAG]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE  , KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE  .ordinal()][KerberosConstants.KRB_CRED_INFO_SREALM_TAG]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE  , KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
             new CheckNotNullLength());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE,
UniversalTag.GENERAL_STRING.getValue(),
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE,
UniversalTag.GENERAL_STRING.getValue(),
             new StoreSRealm());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SNAME_TAG]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE,
KerberosConstants.KRB_CRED_INFO_SNAME_TAG,
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SNAME_TAG]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SNAME_TAG,
             new StoreSName());
         
-        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
-            KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
+        super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
+            KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_CADDR_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
             new StoreClientAddresses());
 
         // ---------------------------- OPTIONAL transitions ------------------------
@@ -156,228 +156,227 @@ public final class KrbCredInfoGrammar ex
         // transition from key to pname
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_PNAME_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_PNAME_TAG,
-         new CheckNotNullLength());
+         new StorePName());
 
         // transition from key to flags
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_FLAGS_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE,
KerberosConstants.KRB_CRED_INFO_FLAGS_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_FLAGS_TAG,
          new CheckNotNullLength());
 
         // transition from key to authtime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE,
KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG,
          new CheckNotNullLength());
 
         // transition from key to starttime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE,
KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG,
          new CheckNotNullLength());
 
         // transition from key to endtime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
          new CheckNotNullLength());
 
         // transition from key to renewtill
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
          new CheckNotNullLength());
 
         // transition from key to srealm
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SREALM_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
          new CheckNotNullLength());
 
         // transition from key to sname
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SNAME_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SNAME_TAG,
-         new CheckNotNullLength());
+         new StoreSName());
 
         // transition from key to caddr
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_KEY_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_CADDR_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
-         new CheckNotNullLength());
+         new StoreClientAddresses());
 
         // transition from prealm to flags
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_FLAGS_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE,
KerberosConstants.KRB_CRED_INFO_FLAGS_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_FLAGS_TAG,
          new CheckNotNullLength());
 
         // transition from prealm to authtime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE,
KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG,
          new CheckNotNullLength());
 
         // transition from prealm to starttime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE,
KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG,
          new CheckNotNullLength());
 
         // transition from prealm to endtime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
          new CheckNotNullLength());
 
         // transition from prealm to renewtill
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
          new CheckNotNullLength());
 
         // transition from prealm to srealm
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SREALM_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
          new CheckNotNullLength());
 
         // transition from prealm to sname
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SNAME_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SNAME_TAG,
-         new CheckNotNullLength());
+         new StoreSName());
 
         // transition from prealm to caddr
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_PREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_CADDR_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
-         new CheckNotNullLength());
+         new StoreClientAddresses());
 
         // transition from pname to authtime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE,
KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_AUTHTIME_TAG,
          new CheckNotNullLength());
 
         // transition from pname to starttime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE,
KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG,
          new CheckNotNullLength());
 
         // transition from pname to endtime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
          new CheckNotNullLength());
 
         // transition from pname to renewtill
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
          new CheckNotNullLength());
 
         // transition from pname to srealm
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SREALM_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
          new CheckNotNullLength());
 
         // transition from pname to sname
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SNAME_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SNAME_TAG,
-         new CheckNotNullLength());
+         new StoreSName());
 
         // transition from pname to caddr
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_PNAME_TAG_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_CADDR_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
-         new CheckNotNullLength());
+         new StoreClientAddresses());
 
         // transition from flags to starttime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE,
KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_STARTTIME_TAG,
          new CheckNotNullLength());
 
         // transition from flags to endtime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
          new CheckNotNullLength());
 
         // transition from flags to renewtill
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
          new CheckNotNullLength());
 
         // transition from flags to srealm
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SREALM_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
          new CheckNotNullLength());
 
         // transition from flags to sname
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SNAME_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SNAME_TAG,
-         new CheckNotNullLength());
+         new StoreSName());
 
         // transition from flags to caddr
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_FLAGS_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_CADDR_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
-         new CheckNotNullLength());
+         new StoreClientAddresses());
 
         // transition from authtime to endtime
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_ENDTIME_TAG,
          new CheckNotNullLength());
 
         // transition from authtime to renewtill
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
          new CheckNotNullLength());
 
         // transition from authtime to srealm
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SREALM_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
          new CheckNotNullLength());
 
         // transition from authtime to sname
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SNAME_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SNAME_TAG,
-         new CheckNotNullLength());
+         new StoreSName());
 
         // transition from authtime to caddr
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_AUTHTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_CADDR_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
-         new CheckNotNullLength());
+         new StoreClientAddresses());
 
         // transition from starttime to renewtill
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_RENEWTILL_TAG,
          new CheckNotNullLength());
 
         // transition from starttime to srealm
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SREALM_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
          new CheckNotNullLength());
 
         // transition from starttime to sname
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SNAME_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SNAME_TAG,
-         new CheckNotNullLength());
+         new StoreSName());
 
         // transition from starttime to caddr
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_STARTTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_CADDR_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
-         new CheckNotNullLength());
+         new StoreClientAddresses());
 
         // transition from endtime to srealm
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SREALM_TAG]
= new GrammarTransition(
-         KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
+         KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SREALM_TAG,
          new CheckNotNullLength());
 
         // transition from endtime to sname
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SNAME_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SNAME_TAG,
-         new CheckNotNullLength());
+         new StoreSName());
 
         // transition from endtime to caddr
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_ENDTIME_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_CADDR_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
-         new CheckNotNullLength());
+         new StoreClientAddresses());
 
         // transition from renewtill to sname
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_SNAME_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_SNAME_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_SNAME_TAG,
-         new CheckNotNullLength());
+         new StoreSName());
 
         // transition from renewtill to caddr
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_RENEWTILL_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_CADDR_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
-         new CheckNotNullLength());
+         new StoreClientAddresses());
 
         // transition from srealm to caddr
         super.transitions[KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE.ordinal()][KerberosConstants.KRB_CRED_INFO_CADDR_TAG]
= new GrammarTransition(
          KrbCredInfoStatesEnum.KRB_CRED_INFO_SREALM_STATE, KrbCredInfoStatesEnum.KRB_CRED_INFO_CADDR_TAG_STATE,
KerberosConstants.KRB_CRED_INFO_CADDR_TAG,
-         new CheckNotNullLength());
-
+         new StoreClientAddresses());
     }
 
 

Added: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java?rev=1039057&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java
(added)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java
Thu Nov 25 14:22:10 2010
@@ -0,0 +1,283 @@
+/*
+ *   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 java.lang.reflect.Field;
+import java.net.InetAddress;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.directory.shared.asn1.ber.Asn1Decoder;
+import org.apache.directory.shared.asn1.codec.DecoderException;
+import org.apache.directory.shared.kerberos.KerberosTime;
+import org.apache.directory.shared.kerberos.codec.krbCredInfo.KrbCredInfoContainer;
+import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
+import org.apache.directory.shared.kerberos.codec.types.PrincipalNameType;
+import org.apache.directory.shared.kerberos.components.EncryptionKey;
+import org.apache.directory.shared.kerberos.components.HostAddress;
+import org.apache.directory.shared.kerberos.components.HostAddresses;
+import org.apache.directory.shared.kerberos.components.KrbCredInfo;
+import org.apache.directory.shared.kerberos.components.PrincipalName;
+import org.apache.directory.shared.kerberos.flags.TicketFlag;
+import org.apache.directory.shared.kerberos.flags.TicketFlags;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+
+/**
+ * Test cases for KrbCredInfo codec.
+ * 
+ * This test class assumes that the encoding of KrbCredInfo class is correct and highly relies
on its functionality
+ * to generate test PDUs instead of generating them by hand. Also note that the accuracy
of this test case depends on
+ * the accuracy of the encoding done by the components constituted in KrbCredInfo ASN.1 structure

+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class KrbCredInfoDecoderTest
+{
+    private EncryptionKey key;
+    private String pRealm;
+    private PrincipalName pName;
+    private TicketFlags ticketFlags;
+    private KerberosTime authTime;
+    private KerberosTime startTime;
+    private KerberosTime endTime;
+    private KerberosTime renewtill;
+    private String sRealm;
+    private PrincipalName sName;
+    private HostAddresses clientAddresses;
+
+    private List<FieldValueHolder> optionalFieldValueList;
+
+    class FieldValueHolder
+    {
+        String fieldName;
+        Object value;
+
+
+        FieldValueHolder( String fieldName, Object value )
+        {
+            this.fieldName = fieldName;
+            this.value = value;
+        }
+
+
+        @Override
+        public String toString()
+        {
+            return "FieldValueHolder [fieldName=" + fieldName + ", value=" + value + "]";
+        }
+    }
+
+
+    @Before
+    public void setup() throws Exception
+    {
+        optionalFieldValueList = new ArrayList<FieldValueHolder>();
+
+        key = new EncryptionKey( EncryptionType.DES3_CBC_MD5, new byte[]
+            { 0, 1 } );
+
+        pRealm = "prealm";
+        // NOTE: we have to add each field manually cause order is important
+        optionalFieldValueList.add( new FieldValueHolder( "pRealm", pRealm ) );
+
+        ticketFlags = new TicketFlags( TicketFlag.INITIAL.getValue() );
+        optionalFieldValueList.add( new FieldValueHolder( "ticketFlags", ticketFlags ) );
+
+        authTime = new KerberosTime( new Date().getTime() );
+        optionalFieldValueList.add( new FieldValueHolder( "authTime", authTime ) );
+
+        startTime = new KerberosTime( new Date().getTime() );
+        optionalFieldValueList.add( new FieldValueHolder( "startTime", startTime ) );
+
+        endTime = new KerberosTime( new Date().getTime() );
+        optionalFieldValueList.add( new FieldValueHolder( "endTime", endTime ) );
+
+        renewtill = new KerberosTime( new Date().getTime() );
+        optionalFieldValueList.add( new FieldValueHolder( "renewtill", renewtill ) );
+
+        sRealm = "srealm";
+        optionalFieldValueList.add( new FieldValueHolder( "sRealm", sRealm ) );
+
+        pName = new PrincipalName( "pname", PrincipalNameType.KRB_NT_PRINCIPAL );
+        optionalFieldValueList.add( new FieldValueHolder( "pName", pName ) );
+
+        sName = new PrincipalName( "sname", PrincipalNameType.KRB_NT_PRINCIPAL );
+        optionalFieldValueList.add( new FieldValueHolder( "sName", sName ) );
+
+        clientAddresses = new HostAddresses( new HostAddress[]
+            { new HostAddress( InetAddress.getByName( "localhost" ) ) } );
+        optionalFieldValueList.add( new FieldValueHolder( "clientAddresses", clientAddresses
) );
+    }
+
+
+    @Test
+    public void testKrbCredInfo() throws Exception
+    {
+        // algorithm:
+        // start from the first mandatory element and then add one of the subsequent OPTIONAL
elements(in order) then 
+        // start adding/removing subsequent OPTIONAL elements(those which fall after the
above OPTIONAL element)
+        // one by one and then test decoding
+
+        int size = optionalFieldValueList.size();
+        for ( int i = 0; i < size; i++ )
+        {
+            KrbCredInfo expected = new KrbCredInfo();
+            expected.setKey( key );
+            Map<String, Field> krbCredInfoFieldNameMap = getFieldMap( expected );
+
+            List<FieldValueHolder> presentFieldList = new ArrayList<FieldValueHolder>();
+
+            FieldValueHolder fieldValHolder = optionalFieldValueList.get( i );
+            presentFieldList.add( fieldValHolder );
+
+            Field f = krbCredInfoFieldNameMap.get( fieldValHolder.fieldName.toLowerCase()
);
+            f.set( expected, fieldValHolder.value );
+
+            for ( int j = i + 1; j < size; j++ )
+            {
+                fieldValHolder = optionalFieldValueList.get( j );
+                presentFieldList.add( fieldValHolder );
+                f = krbCredInfoFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+                f.set( expected, fieldValHolder.value );
+            }
+
+            ByteBuffer stream = ByteBuffer.allocate( expected.computeLength() );
+            expected.encode( stream );
+            stream.flip();
+
+            Asn1Decoder decoder = new Asn1Decoder();
+            KrbCredInfoContainer container = new KrbCredInfoContainer();
+            container.setStream( stream );
+
+            try
+            {
+                decoder.decode( stream, container );
+            }
+            catch ( DecoderException e )
+            {
+                // NOTE: keep this sysout for easy debugging (no need to setup a logger)
+                System.out.println( "failed sequence:\n" + expected );
+                throw e;
+            }
+
+            KrbCredInfo actual = container.getKrbCredInfo();
+            assertValues( presentFieldList, actual );
+        }
+
+    }
+
+
+    @Test
+    public void testKrbCredInfoWithEachOptElement() throws Exception
+    {
+        // algorithm:
+        // start from the first mandatory element and add ONLY one OPTIONAL element and then
test decoding
+
+        int size = optionalFieldValueList.size();
+        for ( int i = size - 1; i >= 0; i-- )
+        {
+            KrbCredInfo expected = new KrbCredInfo();
+            expected.setKey( key );
+            Map<String, Field> krbCredInfoFieldNameMap = getFieldMap( expected );
+
+            List<FieldValueHolder> presentFieldList = new ArrayList<FieldValueHolder>();
+
+            FieldValueHolder fieldValHolder = optionalFieldValueList.get( i );
+            presentFieldList.add( fieldValHolder );
+
+            Field f = krbCredInfoFieldNameMap.get( fieldValHolder.fieldName.toLowerCase()
);
+            f.set( expected, fieldValHolder.value );
+
+            ByteBuffer stream = ByteBuffer.allocate( expected.computeLength() );
+            expected.encode( stream );
+            stream.flip();
+
+            Asn1Decoder decoder = new Asn1Decoder();
+            KrbCredInfoContainer container = new KrbCredInfoContainer();
+            container.setStream( stream );
+
+            try
+            {
+                decoder.decode( stream, container );
+            }
+            catch ( DecoderException e )
+            {
+                // NOTE: keep this sysout for easy debugging (no need to setup a logger)
+                System.out.println( "failed sequence:\n" + expected );
+                throw e;
+            }
+
+            KrbCredInfo actual = container.getKrbCredInfo();
+            assertValues( presentFieldList, actual );
+        }
+    }
+
+
+    /**
+     * compare the values that are inserted into the KrbCredInfo objects before encoding
to
+     * those that are obtained from decoded KrbCredInfo
+     * 
+     * @param presentFieldList the list of values that were inserted in the KrbCredInfo class
before encoding
+     * @param decoded the decoded KrbCredInfo object 
+     */
+    private void assertValues( List<FieldValueHolder> presentFieldList, KrbCredInfo
decoded ) throws Exception
+    {
+        Map<String, Field> krbCredInfoFieldNameMap = getFieldMap( decoded );
+        for ( FieldValueHolder fh : presentFieldList )
+        {
+            Field actualField = krbCredInfoFieldNameMap.get( fh.fieldName.toLowerCase() );
+            Object decodedValue = actualField.get( decoded );
+
+            //System.out.println( fh.fieldName + " expected: " + fh.value + " , actual: "
+ decodedValue );
+
+            assertTrue( decodedValue.equals( fh.value ) );
+        }
+    }
+
+
+    /**
+     * create a map with the field's name and field objects of the KrbCreInfo
+     * 
+     * @param source the KrbCredInfo object
+     */
+    private Map<String, Field> getFieldMap( KrbCredInfo source )
+    {
+        Field[] fields = source.getClass().getDeclaredFields();
+
+        Map<String, Field> fieldNameMap = new HashMap<String, Field>();
+
+        for ( Field f : fields )
+        {
+            f.setAccessible( true );
+            fieldNameMap.put( f.getName().toLowerCase(), f );
+        }
+
+        return fieldNameMap;
+    }
+}



Mime
View raw message