directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1235326 [14/28] - in /directory/apacheds/trunk: jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-partitio...
Date Tue, 24 Jan 2012 16:15:29 GMT
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java Tue Jan 24 16:15:05 2012
@@ -30,92 +30,92 @@ public enum ChecksumType implements Comp
     /**
      * The "unknown" checksum type.
      */
-    UNKNOWN( -1, "UNKNOWN" ),
+    UNKNOWN(-1, "UNKNOWN"),
 
     /**
      * The "null" checksum type.
      */
-    NULL( 0, "NULL" ),
+    NULL(0, "NULL"),
 
     /**
      * The CRC32 checksum type (RFC3961).
      */
-    CRC32( 1, "CRC32" ),
+    CRC32(1, "CRC32"),
 
     /**
      * The rsa-md4 checksum type (RFC3961).
      */
-    RSA_MD4( 2, "rsa-md4" ),
+    RSA_MD4(2, "rsa-md4"),
 
     /**
      * The rsa-md4-des checksum type (RFC3961).
      */
-    RSA_MD4_DES( 3, "rsa-md4-des" ),
+    RSA_MD4_DES(3, "rsa-md4-des"),
 
     /**
      * The des-mac checksum type (RFC3961).
      */
-    DES_MAC( 4, "des-mac" ),
+    DES_MAC(4, "des-mac"),
 
     /**
      * The des-mac-k checksum type (RFC3961).
      */
-    DES_MAC_K( 5, "rsa-md5" ),
+    DES_MAC_K(5, "rsa-md5"),
 
     /**
      * The rsa-md4-des-k checksum type (RFC3961).
      */
-    RSA_MD4_DES_K( 6, "rsa-md5" ),
+    RSA_MD4_DES_K(6, "rsa-md5"),
 
     /**
      * The rsa-md5 checksum type (RFC3961).
      */
-    RSA_MD5( 7, "rsa-md5" ),
+    RSA_MD5(7, "rsa-md5"),
 
     /**
      * The rsa-md5-des checksum type (RFC3961).
      */
-    RSA_MD5_DES( 8, "rsa-md5-des" ),
+    RSA_MD5_DES(8, "rsa-md5-des"),
 
     /**
      * The rsa-md5-des3 checksum type.
      */
-    RSA_MD5_DES3( 9, "rsa-md5-des3" ),
+    RSA_MD5_DES3(9, "rsa-md5-des3"),
 
     /**
      * The sha1 (unkeyed) checksum type.
      */
-    SHA1( 10, "sha1" ),
+    SHA1(10, "sha1"),
 
     /**
      * The hmac-sha1-des3-kd checksum type (RFC3961).
      */
-    HMAC_SHA1_DES3_KD( 12, "hmac-sha1-des3-kd" ),
+    HMAC_SHA1_DES3_KD(12, "hmac-sha1-des3-kd"),
 
     /**
      * The hmac-sha1-des3 checksum type.
      */
-    HMAC_SHA1_DES3( 13, "hmac-sha1-des3" ),
+    HMAC_SHA1_DES3(13, "hmac-sha1-des3"),
 
     /**
      * The sha1 (unkeyed) checksum type.
      */
-    SHA1_2 ( 14, "sha1" ),
+    SHA1_2(14, "sha1"),
 
     /**
      * The hmac-sha1-96-aes128 checksum type (RFC3962).
      */
-    HMAC_SHA1_96_AES128( 15, "hmac-sha1-96-aes128" ),
+    HMAC_SHA1_96_AES128(15, "hmac-sha1-96-aes128"),
 
     /**
      * The hmac-sha1-96-aes256 checksum type (RFC3962).
      */
-    HMAC_SHA1_96_AES256( 16, "hmac-sha1-96-aes256" ),
+    HMAC_SHA1_96_AES256(16, "hmac-sha1-96-aes256"),
 
     /**
      * The hmac-md5 checksum type (RFC4757).
      */
-    HMAC_MD5( -138, "hmac-md5" );
+    HMAC_MD5(-138, "hmac-md5");
 
     /**
      * The value/code for the checksum type.
@@ -148,25 +148,44 @@ public enum ChecksumType implements Comp
     {
         switch ( type )
         {
-            case -1 : return UNKNOWN;
-            case 0  : return NULL;
-            case 1  : return CRC32;
-            case 2  : return RSA_MD4;
-            case 3  : return RSA_MD4_DES;
-            case 4  : return DES_MAC;
-            case 5  : return DES_MAC_K;
-            case 6  : return RSA_MD4_DES_K;
-            case 7  : return RSA_MD5;
-            case 8  : return RSA_MD5_DES;
-            case 9  : return RSA_MD5_DES3;
-            case 10 : return SHA1;
-            case 12 : return HMAC_SHA1_DES3_KD;
-            case 13 : return HMAC_SHA1_DES3;
-            case 14 : return SHA1_2;
-            case 15 : return HMAC_SHA1_96_AES128;
-            case 16 : return HMAC_SHA1_96_AES256;
-            case -138 : return HMAC_MD5;
-            default : return UNKNOWN;
+            case -1:
+                return UNKNOWN;
+            case 0:
+                return NULL;
+            case 1:
+                return CRC32;
+            case 2:
+                return RSA_MD4;
+            case 3:
+                return RSA_MD4_DES;
+            case 4:
+                return DES_MAC;
+            case 5:
+                return DES_MAC_K;
+            case 6:
+                return RSA_MD4_DES_K;
+            case 7:
+                return RSA_MD5;
+            case 8:
+                return RSA_MD5_DES;
+            case 9:
+                return RSA_MD5_DES3;
+            case 10:
+                return SHA1;
+            case 12:
+                return HMAC_SHA1_DES3_KD;
+            case 13:
+                return HMAC_SHA1_DES3;
+            case 14:
+                return SHA1_2;
+            case 15:
+                return HMAC_SHA1_96_AES128;
+            case 16:
+                return HMAC_SHA1_96_AES256;
+            case -138:
+                return HMAC_MD5;
+            default:
+                return UNKNOWN;
         }
     }
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/ErrorType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/ErrorType.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/ErrorType.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/ErrorType.java Tue Jan 24 16:15:05 2012
@@ -32,10 +32,10 @@ import java.util.List;
  */
 public final class ErrorType implements Comparable<ErrorType>
 {
- 
+
     // TODO Add i18n. Don't no if these error messages are also a response to the client.
     // If so shall they really be i18n?
-    
+
     /**
      * No error.
      */
@@ -467,7 +467,7 @@ public final class ErrorType implements 
     /**
      * Private constructor prevents construction outside of this class.
      */
-    private ErrorType(int value, String name)
+    private ErrorType( int value, String name )
     {
         this.value = value;
         this.name = name;
@@ -515,7 +515,7 @@ public final class ErrorType implements 
      * @param value the value value of the value
      * @return the type corresponding to the value value
      */
-    public static ErrorType getTypeByValue(int ordinal)
+    public static ErrorType getTypeByValue( int ordinal )
     {
         for ( int ii = 0; ii < values.length; ii++ )
         {

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/InvalidTicketException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/InvalidTicketException.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/InvalidTicketException.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/InvalidTicketException.java Tue Jan 24 16:15:05 2012
@@ -23,7 +23,7 @@ package org.apache.directory.shared.kerb
 /**
  * A exception used when there was an error while creating a Ticket
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- */ 
+ */
 public class InvalidTicketException extends KerberosException
 {
     static final long serialVersionUID = 1L;

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/KerberosException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/KerberosException.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/KerberosException.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/KerberosException.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.kerberos.exceptions;
 
+
 import org.apache.directory.shared.kerberos.messages.KrbError;
 
 
@@ -33,7 +34,7 @@ public class KerberosException extends E
 
     /** the kerberos error */
     private KrbError error;
-    
+
     /**
      * The Kerberos error code associated with this exception.
      */
@@ -58,7 +59,7 @@ public class KerberosException extends E
         this.errorCode = errorType.getValue();
     }
 
-    
+
     /**
      * 
      * Creates a new instance of KerberosException.
@@ -72,7 +73,7 @@ public class KerberosException extends E
         this.error = error;
     }
 
-    
+
     /**
      * Creates a KerberosException with an {@link ErrorType} and an
      * underlying {@link Throwable} that caused this fault.

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/AbstractKerberosFlags.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/AbstractKerberosFlags.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/AbstractKerberosFlags.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/AbstractKerberosFlags.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.kerberos.flags;
 
+
 import org.apache.directory.shared.asn1.util.BitString;
 
 
@@ -78,10 +79,10 @@ public abstract class AbstractKerberosFl
         // The first byte contains the number of unused bytes, 0 here as we store 32 bits
         bytes[0] = 0;
 
-        bytes[1] = (byte)(value >> 24);
-        bytes[3] = (byte)( (value >> 16) & 0x00FF );
-        bytes[3] = (byte)( (value >> 8) & 0x00FF );
-        bytes[4] = (byte)(value & 0x00FF);
+        bytes[1] = ( byte ) ( value >> 24 );
+        bytes[3] = ( byte ) ( ( value >> 16 ) & 0x00FF );
+        bytes[3] = ( byte ) ( ( value >> 8 ) & 0x00FF );
+        bytes[4] = ( byte ) ( value & 0x00FF );
 
         super.setData( bytes );
         this.value = value;
@@ -100,7 +101,8 @@ public abstract class AbstractKerberosFl
             throw new IllegalArgumentException( "The given flags is not correct" );
         }
 
-        value = ( ( flags[1] & 0x00FF ) << 24 ) | ( ( flags[2] & 0x00FF ) << 16 ) | ( ( flags[3] & 0x00FF ) << 8 ) | ( 0x00FF & flags[4] );
+        value = ( ( flags[1] & 0x00FF ) << 24 ) | ( ( flags[2] & 0x00FF ) << 16 ) | ( ( flags[3] & 0x00FF ) << 8 )
+            | ( 0x00FF & flags[4] );
     }
 
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/KerberosFlag.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/KerberosFlag.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/KerberosFlag.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/KerberosFlag.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.kerberos.flags;
 
+
 /**
  * This interface must be implemented by all the inherited Flag classes :
  * - TicketFlag

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/KerberosFlags.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/KerberosFlags.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/KerberosFlags.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/KerberosFlags.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.kerberos.flags;
 
+
 /**
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -30,8 +31,8 @@ public interface KerberosFlags
      * Returns the int value associated with the flags
      */
     int getIntValue();
-    
-    
+
+
     /**
      * Check if a flag is set for the actual value
      * 
@@ -39,16 +40,16 @@ public interface KerberosFlags
      * @return True if the flag is set in the list of flags
      */
     boolean isFlagSet( KerberosFlag flag );
-    
-    
+
+
     /**
      * Check if a flag is set
      * @param flag The flags to test
      * @return True if the flag is set in the list of flags
      */
     boolean isFlagSet( int flag );
-    
-    
+
+
     /**
      * Set a flag in a list of flags
      * 
@@ -56,15 +57,15 @@ public interface KerberosFlags
      */
     void setFlag( KerberosFlag flag );
 
-    
+
     /**
      * Set a flag in a list of flags
      * 
      * @param flag The flag to set
      */
     void setFlag( int flag );
-    
-    
+
+
     /**
      * clear a flag in a list of flags
      * 
@@ -72,7 +73,7 @@ public interface KerberosFlags
      */
     void clearFlag( KerberosFlag flag );
 
-    
+
     /**
      * clear a flag in a list of flags
      * 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/TicketFlag.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/TicketFlag.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/TicketFlag.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/TicketFlag.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.kerberos.flags;
 
+
 /**
  * An enum to describe all the TicketFlag possible values.
  * 
@@ -117,11 +118,10 @@ public enum TicketFlag implements Kerber
      */
     MAX_VALUE(32);
 
-    
     // The interned value.
     private int value;
-    
-    
+
+
     /**
      * Class constructor
      */
@@ -129,8 +129,8 @@ public enum TicketFlag implements Kerber
     {
         this.value = value;
     }
-    
-    
+
+
     /**
      * @return The value associated with this flag
      */

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/TicketFlags.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/TicketFlags.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/TicketFlags.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/TicketFlags.java Tue Jan 24 16:15:05 2012
@@ -30,16 +30,16 @@ public class TicketFlags extends Abstrac
 {
     private static final long serialVersionUID = 1L;
 
-    
-   /**
-     * Basic constructor of a TicketFlags BitString
-     */
+
+    /**
+      * Basic constructor of a TicketFlags BitString
+      */
     public TicketFlags()
     {
         super();
     }
-    
-    
+
+
     /**
      * Constructor of a TicketFlags BitString with an int value
      */
@@ -47,8 +47,8 @@ public class TicketFlags extends Abstrac
     {
         super( flags );
     }
-    
-    
+
+
     /**
      * Basic constructor of a TicketFlags BitString with a byte array
      */
@@ -56,8 +56,8 @@ public class TicketFlags extends Abstrac
     {
         super( flags );
     }
-    
-    
+
+
     /**
      * Ticket flag - reserved
      */
@@ -66,7 +66,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.RESERVED );
     }
 
-    
+
     /**
      * Ticket flag - forwardable
      */
@@ -74,7 +74,7 @@ public class TicketFlags extends Abstrac
     {
         return isFlagSet( TicketFlag.FORWARDABLE );
     }
-    
+
 
     /**
      * Ticket flag - forwarded
@@ -84,7 +84,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.FORWARDED );
     }
 
-    
+
     /**
      * Ticket flag - proxiable
      */
@@ -93,7 +93,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.PROXIABLE );
     }
 
-    
+
     /**
      * Ticket flag - proxy
      */
@@ -102,7 +102,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.PROXY );
     }
 
-    
+
     /**
      * Ticket flag - may be postdated
      */
@@ -111,7 +111,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.MAY_POSTDATE );
     }
 
-    
+
     /**
      * Ticket flag - postdated
      */
@@ -120,7 +120,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.POSTDATED );
     }
 
-    
+
     /**
      * Ticket flag - invalid
      */
@@ -129,7 +129,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.INVALID );
     }
 
-    
+
     /**
      * Ticket flag - renewable
      */
@@ -138,7 +138,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.RENEWABLE );
     }
 
-    
+
     /**
      * Ticket flag - initial
      */
@@ -147,7 +147,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.INITIAL );
     }
 
-    
+
     /**
      * Ticket flag - pre-authentication
      */
@@ -156,7 +156,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.PRE_AUTHENT );
     }
 
-    
+
     /**
      * Ticket flag - hardware authentication
      */
@@ -165,7 +165,7 @@ public class TicketFlags extends Abstrac
         return isFlagSet( TicketFlag.HW_AUTHENT );
     }
 
-    
+
     /**
      * Ticket flag - transitedEncoding policy checked
      */
@@ -173,7 +173,7 @@ public class TicketFlags extends Abstrac
     {
         return isFlagSet( TicketFlag.TRANSITED_POLICY_CHECKED );
     }
-    
+
 
     /**
      * Ticket flag - OK as delegate
@@ -182,8 +182,8 @@ public class TicketFlags extends Abstrac
     {
         return isFlagSet( TicketFlag.OK_AS_DELEGATE );
     }
-    
-    
+
+
     /**
      * Converts the object to a printable string.
      */

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ApRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ApRep.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ApRep.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ApRep.java Tue Jan 24 16:15:05 2012
@@ -55,7 +55,7 @@ public class ApRep extends KerberosMessa
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
-    
+
     /** The encryptedData, an encrypted EncAPRepPart */
     private EncryptedData encPart;
 
@@ -66,15 +66,16 @@ public class ApRep extends KerberosMessa
     private int apRepLength;
     private int apRepSeqLength;
 
+
     /**
      * Creates a new instance of AP-REP.
      */
-    public ApRep() 
+    public ApRep()
     {
         super( KerberosMessageType.AP_REP );
     }
 
-    
+
     /**
      * Returns the {@link EncryptedData}.
      *
@@ -127,22 +128,22 @@ public class ApRep extends KerberosMessa
 
         // Compute the msg-type length
         msgTypeLength = 1 + 1 + Value.getNbBytes( getMessageType().getValue() );
-        
+
         // Compute the enc-part length
         encPartLength = encPart.computeLength();
-        
+
         // Compute the sequence size
-        apRepLength = 
+        apRepLength =
             1 + TLV.getNbBytes( pvnoLength ) + pvnoLength +
-            1 + TLV.getNbBytes( msgTypeLength ) + msgTypeLength +
-            1 + TLV.getNbBytes( encPartLength ) + encPartLength;
-        
+                1 + TLV.getNbBytes( msgTypeLength ) + msgTypeLength +
+                1 + TLV.getNbBytes( encPartLength ) + encPartLength;
+
         apRepSeqLength = 1 + TLV.getNbBytes( apRepLength ) + apRepLength;
-        
+
         return 1 + TLV.getNbBytes( apRepSeqLength ) + apRepSeqLength;
     }
-    
-    
+
+
     /**
      * Encode the AP-REP component
      * 
@@ -156,51 +157,51 @@ public class ApRep extends KerberosMessa
         {
             buffer = ByteBuffer.allocate( computeLength() );
         }
-        
+
         try
         {
             // The AP-REP Tag
-            buffer.put( (byte)KerberosConstants.AP_REP_TAG );
+            buffer.put( ( byte ) KerberosConstants.AP_REP_TAG );
             buffer.put( TLV.getBytes( apRepSeqLength ) );
-            
+
             // The AP-REP SEQ Tag
             buffer.put( UniversalTag.SEQUENCE.getValue() );
             buffer.put( TLV.getBytes( apRepLength ) );
-            
+
             // The PVNO -------------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AP_REP_PVNO_TAG );
+            buffer.put( ( byte ) KerberosConstants.AP_REP_PVNO_TAG );
             buffer.put( TLV.getBytes( pvnoLength ) );
-            
+
             // The value
             Value.encode( buffer, getProtocolVersionNumber() );
-            
+
             // The msg-type ---------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AP_REP_MSG_TYPE_TAG );
+            buffer.put( ( byte ) KerberosConstants.AP_REP_MSG_TYPE_TAG );
             buffer.put( TLV.getBytes( msgTypeLength ) );
-            
+
             // The value
             Value.encode( buffer, getMessageType().getValue() );
-            
+
             // The enc-part ---------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AP_REP_ENC_PART_TAG );
+            buffer.put( ( byte ) KerberosConstants.AP_REP_ENC_PART_TAG );
             buffer.put( TLV.getBytes( encPartLength ) );
-            
+
             // The value
             encPart.encode( buffer );
         }
         catch ( BufferOverflowException boe )
         {
-            LOG.error( I18n.err( I18n.ERR_137, 1 + TLV.getNbBytes( apRepLength ) + apRepLength, 
+            LOG.error( I18n.err( I18n.ERR_137, 1 + TLV.getNbBytes( apRepLength ) + apRepLength,
                 buffer.capacity() ) );
             throw new EncoderException( I18n.err( I18n.ERR_138 ) );
         }
 
         if ( IS_DEBUG )
         {
-            LOG.debug( "AP-REP encoding : {}", Strings.dumpBytes(buffer.array()) );
+            LOG.debug( "AP-REP encoding : {}", Strings.dumpBytes( buffer.array() ) );
             LOG.debug( "AP-REP initial value : {}", toString() );
         }
 
@@ -219,7 +220,7 @@ public class ApRep extends KerberosMessa
         sb.append( "  pvno : " ).append( getProtocolVersionNumber() ).append( "\n" );
         sb.append( "  msg-type : " ).append( getMessageType() ).append( "\n" );
         sb.append( "  enc-part : " ).append( encPart ).append( "\n" );
-        
+
         return sb.toString();
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ApReq.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ApReq.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ApReq.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ApReq.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.kerberos.messages;
 
+
 import java.nio.BufferOverflowException;
 import java.nio.ByteBuffer;
 
@@ -59,10 +60,10 @@ public class ApReq extends KerberosMessa
 
     /** The AP options */
     private ApOptions apOptions;
-    
+
     /** The Ticket */
     private Ticket ticket;
-    
+
     /** The encryptedData, an encrypted Authenticator */
     private EncryptedData authenticator;
 
@@ -75,6 +76,7 @@ public class ApReq extends KerberosMessa
     private int apReqLength;
     private int apReqSeqLength;
 
+
     /**
      * Creates a new instance of ApplicationRequest.
      */
@@ -217,36 +219,36 @@ public class ApReq extends KerberosMessa
     public int computeLength()
     {
         reset();
-        
+
         // Compute the PVNO length.
         pvnoLength = 1 + 1 + Value.getNbBytes( getProtocolVersionNumber() );
 
         // Compute the msg-type length
         msgTypeLength = 1 + 1 + Value.getNbBytes( getMessageType().getValue() );
-        
+
         // Compute the APOptions length
         apOptionsLength = 1 + 1 + apOptions.getBytes().length;
-        
+
         // Compute the ticket length
         ticketLength = ticket.computeLength();
-        
+
         // Compute the authenticator length
         authenticatorLength = authenticator.computeLength();
-        
+
         // Compute the sequence size
         apReqLength =
             1 + TLV.getNbBytes( pvnoLength ) + pvnoLength +
-            1 + TLV.getNbBytes( msgTypeLength ) + msgTypeLength +
-            1 + TLV.getNbBytes( apOptionsLength ) + apOptionsLength +
-            1 + TLV.getNbBytes( ticketLength ) + ticketLength +
-            1 + TLV.getNbBytes( authenticatorLength ) + authenticatorLength;
-        
+                1 + TLV.getNbBytes( msgTypeLength ) + msgTypeLength +
+                1 + TLV.getNbBytes( apOptionsLength ) + apOptionsLength +
+                1 + TLV.getNbBytes( ticketLength ) + ticketLength +
+                1 + TLV.getNbBytes( authenticatorLength ) + authenticatorLength;
+
         apReqSeqLength = 1 + TLV.getNbBytes( apReqLength ) + apReqLength;
-        
+
         return 1 + TLV.getNbBytes( apReqSeqLength ) + apReqSeqLength;
     }
 
-    
+
     /**
      * Encode the AP-REQ component
      * 
@@ -264,50 +266,50 @@ public class ApReq extends KerberosMessa
         try
         {
             // The AP-REP Tag
-            buffer.put( (byte)KerberosConstants.AP_REQ_TAG );
+            buffer.put( ( byte ) KerberosConstants.AP_REQ_TAG );
             buffer.put( TLV.getBytes( apReqSeqLength ) );
-            
+
             // The AP-REP SEQ Tag
             buffer.put( UniversalTag.SEQUENCE.getValue() );
             buffer.put( TLV.getBytes( apReqLength ) );
-            
+
             // The PVNO -------------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AP_REQ_PVNO_TAG );
+            buffer.put( ( byte ) KerberosConstants.AP_REQ_PVNO_TAG );
             buffer.put( TLV.getBytes( pvnoLength ) );
-            
+
             // The value
             Value.encode( buffer, getProtocolVersionNumber() );
-            
+
             // The msg-type ---------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AP_REQ_MSG_TYPE_TAG );
+            buffer.put( ( byte ) KerberosConstants.AP_REQ_MSG_TYPE_TAG );
             buffer.put( TLV.getBytes( msgTypeLength ) );
-            
+
             // The value
             Value.encode( buffer, getMessageType().getValue() );
-            
+
             // The ap-options -------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AP_REQ_AP_OPTIONS_TAG );
+            buffer.put( ( byte ) KerberosConstants.AP_REQ_AP_OPTIONS_TAG );
             buffer.put( TLV.getBytes( apOptionsLength ) );
-            
+
             // The value
             Value.encode( buffer, apOptions );
-            
+
             // The ticket -----------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AP_REQ_TICKET_TAG );
+            buffer.put( ( byte ) KerberosConstants.AP_REQ_TICKET_TAG );
             buffer.put( TLV.getBytes( ticketLength ) );
-            
+
             // The value
             ticket.encode( buffer );
-            
+
             // The authenticator ----------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AP_REQ_AUTHENTICATOR_TAG );
+            buffer.put( ( byte ) KerberosConstants.AP_REQ_AUTHENTICATOR_TAG );
             buffer.put( TLV.getBytes( authenticatorLength ) );
-            
+
             // The value
             authenticator.encode( buffer );
         }
@@ -320,7 +322,7 @@ public class ApReq extends KerberosMessa
 
         if ( IS_DEBUG )
         {
-            LOG.debug( "AP-REQ encoding : {}", Strings.dumpBytes(buffer.array()) );
+            LOG.debug( "AP-REQ encoding : {}", Strings.dumpBytes( buffer.array() ) );
             LOG.debug( "AP-REQ initial value : {}", toString() );
         }
 
@@ -341,8 +343,8 @@ public class ApReq extends KerberosMessa
         apReqLength = 0;
         apReqSeqLength = 0;
     }
-    
-    
+
+
     /**
      * @see Object#toString()
      */
@@ -356,7 +358,7 @@ public class ApReq extends KerberosMessa
         sb.append( "  ap-options : " ).append( apOptions ).append( "\n" );
         sb.append( "  ticket : " ).append( ticket ).append( "\n" );
         sb.append( "  authenticator : " ).append( authenticator ).append( "\n" );
-        
+
         return sb.toString();
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java Tue Jan 24 16:15:05 2012
@@ -46,10 +46,11 @@ public class AsRep extends KdcRep
     private int kdcRepLength;
     private int asRepLength;
 
+
     /**
      * Creates a new instance of AS-REP.
      */
-    public AsRep() 
+    public AsRep()
     {
         super( KerberosMessageType.AS_REP );
     }
@@ -65,7 +66,7 @@ public class AsRep extends KdcRep
         return encKdcRepPart.getEndTime();
     }
 
-    
+
     /**
      * Returns the {@link TicketFlags}.
      *
@@ -108,8 +109,8 @@ public class AsRep extends KdcRep
     {
         return encKdcRepPart.getStartTime();
     }
-    
-    
+
+
     /**
      * Returns the server {@link PrincipalName}.
      *
@@ -135,11 +136,11 @@ public class AsRep extends KdcRep
     {
         kdcRepLength = super.computeLength();
         asRepLength = 1 + TLV.getNbBytes( kdcRepLength ) + kdcRepLength;
-        
+
         return asRepLength;
     }
-    
-    
+
+
     /**
      * Encode the AS-REP component
      * 
@@ -153,14 +154,14 @@ public class AsRep extends KdcRep
         {
             buffer = ByteBuffer.allocate( computeLength() );
         }
-        
+
         // The AS-REP SEQ Tag
-        buffer.put( (byte)KerberosConstants.AS_REP_TAG );
+        buffer.put( ( byte ) KerberosConstants.AS_REP_TAG );
         buffer.put( TLV.getBytes( kdcRepLength ) );
-        
+
         // The KDC-REP --------------------------------------------------------
         super.encode( buffer );
-        
+
         return buffer;
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsReq.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsReq.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsReq.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsReq.java Tue Jan 24 16:15:05 2012
@@ -42,15 +42,16 @@ public class AsReq extends KdcReq
     // Storage for computed lengths
     private int kdcReqLength;
 
+
     /**
      * Creates a new instance of AS-REQ.
      */
-    public AsReq() 
+    public AsReq()
     {
         super( KerberosMessageType.AS_REQ );
     }
 
-    
+
     /**
      * Compute the AS-REQ length
      * <pre>
@@ -66,8 +67,8 @@ public class AsReq extends KdcReq
         kdcReqLength = super.computeLength();
         return 1 + TLV.getNbBytes( kdcReqLength ) + kdcReqLength;
     }
-    
-    
+
+
     /**
      * Encode the AS-REQ component
      * 
@@ -81,14 +82,14 @@ public class AsReq extends KdcReq
         {
             buffer = ByteBuffer.allocate( computeLength() );
         }
-        
+
         // The AS-REQ SEQ Tag
-        buffer.put( (byte)KerberosConstants.AS_REQ_TAG );
+        buffer.put( ( byte ) KerberosConstants.AS_REQ_TAG );
         buffer.put( TLV.getBytes( kdcReqLength ) );
-        
+
         // The KDC-REQ --------------------------------------------------------
         super.encode( buffer );
-        
+
         return buffer;
     }
 }

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=1235326&r1=1235325&r2=1235326&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 Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.kerberos.messages;
 
+
 import java.nio.BufferOverflowException;
 import java.nio.ByteBuffer;
 
@@ -39,8 +40,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-
-
 /**
  * A structure to hold the authenticator data.
  *  It will store the object described by the ASN.1 grammar :
@@ -69,22 +68,22 @@ public class Authenticator extends Kerbe
 
     /** The authenticator version number */
     private int versionNumber;
-    
+
     /** The client realm */
     private String crealm;
-    
+
     /** The client principalName */
     private PrincipalName cname;
-    
+
     /** The checksum */
     private Checksum cksum;
-    
+
     /** The client microseconds */
     private int cusec;
-    
+
     /** The client time */
     private KerberosTime ctime;
-    
+
     /** The sub-session key */
     private EncryptionKey subKey;
 
@@ -107,7 +106,6 @@ public class Authenticator extends Kerbe
     private int authorizationDataLength;
     private int authenticatorSeqLength;
     private int authenticatorLength;
-    
 
 
     /**
@@ -283,8 +281,8 @@ public class Authenticator extends Kerbe
     {
         this.versionNumber = versionNumber;
     }
-    
-    
+
+
     /**
      * Compute the Authenticator length
      * <pre>
@@ -327,20 +325,20 @@ public class Authenticator extends Kerbe
     public int computeLength()
     {
         reset();
-        
+
         // Compute the Authenticator version length.
         authenticatorVnoLength = 1 + 1 + Value.getNbBytes( getProtocolVersionNumber() );
-        authenticatorSeqLength =  1 + TLV.getNbBytes( authenticatorVnoLength ) + authenticatorVnoLength;
+        authenticatorSeqLength = 1 + TLV.getNbBytes( authenticatorVnoLength ) + authenticatorVnoLength;
 
         // Compute the  crealm length.
-        crealmBytes = Strings.getBytesUtf8(crealm);
+        crealmBytes = Strings.getBytesUtf8( crealm );
         crealmLength = 1 + TLV.getNbBytes( crealmBytes.length ) + crealmBytes.length;
         authenticatorSeqLength += 1 + TLV.getNbBytes( crealmLength ) + crealmLength;
 
         // Compute the cname length
         cnameLength = cname.computeLength();
         authenticatorSeqLength += 1 + TLV.getNbBytes( cnameLength ) + cnameLength;
-        
+
         // Compute the cksum length if any
         if ( cksum != null )
         {
@@ -369,7 +367,7 @@ public class Authenticator extends Kerbe
             seqNumberLength = 1 + 1 + Value.getNbBytes( seqNumber );
             authenticatorSeqLength += 1 + TLV.getNbBytes( seqNumberLength ) + seqNumberLength;
         }
-        
+
         // Compute the authorization-data length if any
         if ( authorizationData != null )
         {
@@ -379,10 +377,10 @@ public class Authenticator extends Kerbe
 
         // compute the global size
         authenticatorLength = 1 + TLV.getNbBytes( authenticatorSeqLength ) + authenticatorSeqLength;
-        
+
         return 1 + TLV.getNbBytes( authenticatorLength ) + authenticatorLength;
     }
-    
+
 
     /**
      * Encode the Authenticator message to a PDU.
@@ -423,94 +421,94 @@ public class Authenticator extends Kerbe
         try
         {
             // The Authenticator APPLICATION Tag
-            buffer.put( (byte)KerberosConstants.AUTHENTICATOR_TAG );
+            buffer.put( ( byte ) KerberosConstants.AUTHENTICATOR_TAG );
             buffer.put( TLV.getBytes( authenticatorLength ) );
 
             // The Authenticator SEQUENCE Tag
             buffer.put( UniversalTag.SEQUENCE.getValue() );
             buffer.put( TLV.getBytes( authenticatorSeqLength ) );
-            
+
             // The authenticator-vno ------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG );
+            buffer.put( ( byte ) KerberosConstants.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG );
             buffer.put( TLV.getBytes( authenticatorVnoLength ) );
-            
+
             // The value
             Value.encode( buffer, getProtocolVersionNumber() );
-            
+
             // The crealm -----------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AUTHENTICATOR_CREALM_TAG );
+            buffer.put( ( byte ) KerberosConstants.AUTHENTICATOR_CREALM_TAG );
             buffer.put( TLV.getBytes( crealmLength ) );
-            
+
             // The value
             buffer.put( UniversalTag.GENERAL_STRING.getValue() );
             buffer.put( TLV.getBytes( crealmBytes.length ) );
             buffer.put( crealmBytes );
-            
+
             // The cname ------------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AUTHENTICATOR_CNAME_TAG );
+            buffer.put( ( byte ) KerberosConstants.AUTHENTICATOR_CNAME_TAG );
             buffer.put( TLV.getBytes( cnameLength ) );
-            
+
             // The value
             cname.encode( buffer );
-            
+
             // The cksum, if any ----------------------------------------------
             if ( cksum != null )
             {
                 // The tag
-                buffer.put( (byte)KerberosConstants.AUTHENTICATOR_CKSUM_TAG );
+                buffer.put( ( byte ) KerberosConstants.AUTHENTICATOR_CKSUM_TAG );
                 buffer.put( TLV.getBytes( cksumLength ) );
-                
+
                 // The value
                 cksum.encode( buffer );
             }
-            
+
             // The cusec ------------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AUTHENTICATOR_CUSEC_TAG );
+            buffer.put( ( byte ) KerberosConstants.AUTHENTICATOR_CUSEC_TAG );
             buffer.put( TLV.getBytes( cusecLength ) );
-            
+
             // The value
             Value.encode( buffer, cusec );
-            
+
             // The ctime ------------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AUTHENTICATOR_CTIME_TAG );
+            buffer.put( ( byte ) KerberosConstants.AUTHENTICATOR_CTIME_TAG );
             buffer.put( TLV.getBytes( ctimeLength ) );
-            
+
             // The value
             buffer.put( UniversalTag.GENERALIZED_TIME.getValue() );
-            buffer.put( (byte)0x0F );
+            buffer.put( ( byte ) 0x0F );
             buffer.put( ctime.getBytes() );
-            
+
             // The subkey if any ---------------------------------------------------
             if ( subKey != null )
             {
                 // The tag
-                buffer.put( (byte)KerberosConstants.AUTHENTICATOR_SUBKEY_TAG );
+                buffer.put( ( byte ) KerberosConstants.AUTHENTICATOR_SUBKEY_TAG );
                 buffer.put( TLV.getBytes( subkeyLength ) );
-                
+
                 // The value
                 subKey.encode( buffer );
             }
-            
+
             // The seq-number, if any -----------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.AUTHENTICATOR_SEQ_NUMBER_TAG );
+            buffer.put( ( byte ) KerberosConstants.AUTHENTICATOR_SEQ_NUMBER_TAG );
             buffer.put( TLV.getBytes( seqNumberLength ) );
-            
+
             // The value
             Value.encode( buffer, seqNumber );
-            
+
             // The authorization-data, if any ---------------------------------
             if ( authorizationData != null )
             {
                 // The tag
-                buffer.put( (byte)KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG );
+                buffer.put( ( byte ) KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG );
                 buffer.put( TLV.getBytes( authorizationDataLength ) );
-                
+
                 // The value
                 authorizationData.encode( buffer );
             }
@@ -524,7 +522,7 @@ public class Authenticator extends Kerbe
 
         if ( IS_DEBUG )
         {
-            LOG.debug( "Authenticator encoding : {}", Strings.dumpBytes(buffer.array()) );
+            LOG.debug( "Authenticator encoding : {}", Strings.dumpBytes( buffer.array() ) );
             LOG.debug( "Authenticator initial value : {}", toString() );
         }
 
@@ -550,8 +548,8 @@ public class Authenticator extends Kerbe
         authenticatorSeqLength = 0;
         authenticatorLength = 0;
     }
-    
-    
+
+
     /**
      * @see Object#toString()
      */
@@ -560,29 +558,29 @@ public class Authenticator extends Kerbe
         StringBuilder sb = new StringBuilder();
 
         sb.append( "Authenticator : \n" );
-        
+
         sb.append( "    authenticator-vno : " ).append( getVersionNumber() ).append( '\n' );
         sb.append( "    crealm : " ).append( crealm ).append( '\n' );
         sb.append( "    cname : " ).append( cname ).append( '\n' );
-        
+
         if ( cksum != null )
         {
             sb.append( "    cksum : " ).append( cksum ).append( '\n' );
         }
-        
+
         sb.append( "    cusec : " ).append( cusec ).append( '\n' );
         sb.append( "    ctime : " ).append( ctime ).append( '\n' );
-        
+
         if ( subKey != null )
         {
             sb.append( "    subkey : " ).append( subKey ).append( '\n' );
         }
-        
+
         if ( seqNumber != null )
         {
             sb.append( "    seq-number : " ).append( seqNumber ).append( '\n' );
         }
-        
+
         if ( authorizationData != null )
         {
             sb.append( "    authorization-data : " ).append( authorizationData ).append( '\n' );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncApRepPart.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncApRepPart.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncApRepPart.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncApRepPart.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.kerberos.messages;
 
+
 import java.nio.BufferOverflowException;
 import java.nio.ByteBuffer;
 
@@ -36,7 +37,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-
 /**
  * Encrypted part of the application response.
  *  It will store the object described by the ASN.1 grammar :
@@ -60,13 +60,13 @@ public class EncApRepPart extends Kerber
 
     /** The client time */
     private KerberosTime ctime;
-    
+
     /** the microsecond part of the client's timestamp */
     private int cusec;
-    
+
     /** Encryption key */
     private EncryptionKey subkey; //optional
-    
+
     /** Sequence number */
     private Integer seqNumber; //optional
 
@@ -78,6 +78,7 @@ public class EncApRepPart extends Kerber
     private int encApRepPartSeqLength;
     private int encApRepPartLength;
 
+
     /**
      * Creates a new instance of EncApRepPart.
      */
@@ -106,7 +107,7 @@ public class EncApRepPart extends Kerber
         this.ctime = ctime;
     }
 
-    
+
     /**
      * @return the cusec
      */
@@ -195,23 +196,23 @@ public class EncApRepPart extends Kerber
         // Compute the cusec length
         cusecLength = 1 + 1 + Value.getNbBytes( cusec );
         encApRepPartSeqLength += 1 + TLV.getNbBytes( cusecLength ) + cusecLength;
-        
+
         // Compute the subkey length, if any
         if ( subkey != null )
         {
             subKeyLength = subkey.computeLength();
             encApRepPartSeqLength += 1 + TLV.getNbBytes( subKeyLength ) + subKeyLength;
         }
-        
+
         // Compute the sequence size, if any
         if ( seqNumber != null )
         {
             seqNumberLength = 1 + 1 + Value.getNbBytes( seqNumber );
             encApRepPartSeqLength += 1 + TLV.getNbBytes( seqNumberLength ) + seqNumberLength;
         }
-        
+
         encApRepPartLength = 1 + TLV.getNbBytes( encApRepPartSeqLength ) + encApRepPartSeqLength;
-            
+
         return 1 + TLV.getNbBytes( encApRepPartLength ) + encApRepPartLength;
     }
 
@@ -245,53 +246,53 @@ public class EncApRepPart extends Kerber
         try
         {
             // The EncApRepPart APPLICATION Tag
-            buffer.put( (byte)KerberosConstants.ENC_AP_REP_PART_TAG );
+            buffer.put( ( byte ) KerberosConstants.ENC_AP_REP_PART_TAG );
             buffer.put( TLV.getBytes( encApRepPartLength ) );
 
             // The EncApRepPart SEQ Tag
-            buffer.put( (byte)UniversalTag.SEQUENCE.getValue() );
+            buffer.put( ( byte ) UniversalTag.SEQUENCE.getValue() );
             buffer.put( TLV.getBytes( encApRepPartSeqLength ) );
 
             // The ctime ------------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.ENC_AP_REP_PART_CTIME_TAG );
-            buffer.put( (byte)0x11 );
-            
+            buffer.put( ( byte ) KerberosConstants.ENC_AP_REP_PART_CTIME_TAG );
+            buffer.put( ( byte ) 0x11 );
+
             // The value
-            buffer.put( (byte)UniversalTag.GENERALIZED_TIME.getValue() );
-            buffer.put( (byte)0x0F );
+            buffer.put( ( byte ) UniversalTag.GENERALIZED_TIME.getValue() );
+            buffer.put( ( byte ) 0x0F );
             buffer.put( ctime.getBytes() );
-            
+
             // The cusec ------------------------------------------------------
             // The tag
-            buffer.put( (byte)KerberosConstants.ENC_AP_REP_PART_CUSEC_TAG );
+            buffer.put( ( byte ) KerberosConstants.ENC_AP_REP_PART_CUSEC_TAG );
             buffer.put( TLV.getBytes( cusecLength ) );
-            
+
             // The value
             Value.encode( buffer, cusec );
-            
+
             // The subkey if any ----------------------------------------------
             if ( subkey != null )
             {
                 // The tag
-                buffer.put( (byte)KerberosConstants.ENC_AP_REP_PART_SUB_KEY_TAG );
+                buffer.put( ( byte ) KerberosConstants.ENC_AP_REP_PART_SUB_KEY_TAG );
                 buffer.put( TLV.getBytes( subKeyLength ) );
-                
+
                 // The value
                 subkey.encode( buffer );
             }
-            
+
             // The seq-number, if any -----------------------------------------
             if ( seqNumber != null )
             {
                 // The tag
-                buffer.put( (byte)KerberosConstants.ENC_AP_REP_PART_SEQ_NUMBER_TAG );
+                buffer.put( ( byte ) KerberosConstants.ENC_AP_REP_PART_SEQ_NUMBER_TAG );
                 buffer.put( TLV.getBytes( seqNumberLength ) );
-                
+
                 // The value
                 Value.encode( buffer, seqNumber );
             }
-            
+
         }
         catch ( BufferOverflowException boe )
         {
@@ -302,7 +303,7 @@ public class EncApRepPart extends Kerber
 
         if ( IS_DEBUG )
         {
-            LOG.debug( "EncApRepPart encoding : {}", Strings.dumpBytes(buffer.array()) );
+            LOG.debug( "EncApRepPart encoding : {}", Strings.dumpBytes( buffer.array() ) );
             LOG.debug( "EncApRepPart initial value : {}", toString() );
         }
 
@@ -310,7 +311,6 @@ public class EncApRepPart extends Kerber
     }
 
 
-
     /**
      * @see Object#toString()
      */
@@ -318,17 +318,16 @@ public class EncApRepPart extends Kerber
     {
         StringBuilder sb = new StringBuilder();
 
-
         sb.append( "EncApRepPart : \n" );
-        
+
         sb.append( "    ctime : " ).append( ctime ).append( '\n' );
         sb.append( "    cusec : " ).append( cusec ).append( '\n' );
-        
+
         if ( subkey != null )
         {
             sb.append( "    subkey : " ).append( subkey ).append( '\n' );
         }
-        
+
         if ( seqNumber != null )
         {
             sb.append( "    seq-number : " ).append( seqNumber ).append( '\n' );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncAsRepPart.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncAsRepPart.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncAsRepPart.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncAsRepPart.java Tue Jan 24 16:15:05 2012
@@ -41,14 +41,15 @@ public class EncAsRepPart extends Kerber
 {
     /** The EncKdcRepPart */
     private EncKdcRepPart encKdcRepPart;
-    
+
     // Storage for computed lengths
     private int encKdcRepPartLength;
 
+
     /**
      * Creates a new instance of EncAsRepPart.
      */
-    public EncAsRepPart() 
+    public EncAsRepPart()
     {
         super( KerberosMessageType.ENC_AS_REP_PART );
     }
@@ -71,7 +72,7 @@ public class EncAsRepPart extends Kerber
         this.encKdcRepPart = encKdcRepPart;
     }
 
-    
+
     /**
      * Compute the EncAsRepPart length
      * <pre>
@@ -87,8 +88,8 @@ public class EncAsRepPart extends Kerber
         encKdcRepPartLength = encKdcRepPart.computeLength();
         return 1 + TLV.getNbBytes( encKdcRepPartLength ) + encKdcRepPartLength;
     }
-    
-    
+
+
     /**
      * Encode the EncAsRepPart component
      * 
@@ -102,14 +103,14 @@ public class EncAsRepPart extends Kerber
         {
             buffer = ByteBuffer.allocate( computeLength() );
         }
-        
+
         // The EncAsRepPart Tag
-        buffer.put( (byte)KerberosConstants.ENC_AS_REP_PART_TAG );
+        buffer.put( ( byte ) KerberosConstants.ENC_AS_REP_PART_TAG );
         buffer.put( TLV.getBytes( encKdcRepPartLength ) );
-        
+
         // The EncKdcRepPart --------------------------------------------------------
         encKdcRepPart.encode( buffer );
-        
+
         return buffer;
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncTgsRepPart.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncTgsRepPart.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncTgsRepPart.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/EncTgsRepPart.java Tue Jan 24 16:15:05 2012
@@ -41,14 +41,15 @@ public class EncTgsRepPart extends Kerbe
 {
     /** The EncKdcRepPart */
     private EncKdcRepPart encKdcRepPart;
-    
+
     // Storage for computed lengths
     private int encKdcRepPartLength;
 
+
     /**
      * Creates a new instance of EncTgsRepPart.
      */
-    public EncTgsRepPart() 
+    public EncTgsRepPart()
     {
         super( KerberosMessageType.ENC_TGS_REP_PART );
     }
@@ -71,7 +72,7 @@ public class EncTgsRepPart extends Kerbe
         this.encKdcRepPart = encKdcRepPart;
     }
 
-    
+
     /**
      * Compute the EncTgsRepPart length
      * <pre>
@@ -87,8 +88,8 @@ public class EncTgsRepPart extends Kerbe
         encKdcRepPartLength = encKdcRepPart.computeLength();
         return 1 + TLV.getNbBytes( encKdcRepPartLength ) + encKdcRepPartLength;
     }
-    
-    
+
+
     /**
      * Encode the EncTgsRepPart component
      * 
@@ -102,14 +103,14 @@ public class EncTgsRepPart extends Kerbe
         {
             buffer = ByteBuffer.allocate( computeLength() );
         }
-        
+
         // The EncAsRepPart Tag
-        buffer.put( (byte)KerberosConstants.ENC_TGS_REP_PART_TAG );
+        buffer.put( ( byte ) KerberosConstants.ENC_TGS_REP_PART_TAG );
         buffer.put( TLV.getBytes( encKdcRepPartLength ) );
-        
+
         // The EncKdcRepPart --------------------------------------------------------
         encKdcRepPart.encode( buffer );
-        
+
         return buffer;
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KerberosMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KerberosMessage.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KerberosMessage.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KerberosMessage.java Tue Jan 24 16:15:05 2012
@@ -19,12 +19,12 @@
  */
 package org.apache.directory.shared.kerberos.messages;
 
+
 import org.apache.directory.shared.asn1.AbstractAsn1Object;
 import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.KerberosMessageType;
 
 
-
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -32,7 +32,7 @@ public abstract class KerberosMessage ex
 {
     /** The protocol version (should be 5) */
     private int protocolVersionNumber = KerberosConstants.KERBEROS_V5;
-    
+
     /** The message type */
     private KerberosMessageType messageType;
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbCred.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbCred.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbCred.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbCred.java Tue Jan 24 16:15:05 2012
@@ -63,7 +63,6 @@ public class KrbCred extends KerberosMes
     /** encrypted part of the message */
     private EncryptedData encPart;
 
-
     private int pvnoLen;
     private int msgTypeLen;
     private int ticketsSeqLen;
@@ -72,6 +71,7 @@ public class KrbCred extends KerberosMes
     private int krbCredSeqLen;
     private int krbCredLen;
 
+
     /**
      * Creates a new instance of KrbCred.
      */
@@ -190,7 +190,7 @@ public class KrbCred extends KerberosMes
 
         if ( IS_DEBUG )
         {
-            log.debug( "KrbCred encoding : {}", Strings.dumpBytes(buffer.array()) );
+            log.debug( "KrbCred encoding : {}", Strings.dumpBytes( buffer.array() ) );
             log.debug( "KrbCred initial value : {}", toString() );
         }
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java Tue Jan 24 16:15:05 2012
@@ -159,7 +159,7 @@ public class KrbError extends KerberosMe
         {
             return 0;
         }
-        
+
         return cusec;
     }
 
@@ -334,7 +334,7 @@ public class KrbError extends KerberosMe
         this.eData = eData;
     }
 
-    
+
     /**
      * Compute the KRB-ERROR length
      * <pre>
@@ -438,7 +438,7 @@ public class KrbError extends KerberosMe
         // The crealm, if any
         if ( cRealm != null )
         {
-            crealmBytes = Strings.getBytesUtf8(cRealm);
+            crealmBytes = Strings.getBytesUtf8( cRealm );
             cRealmLength = 1 + TLV.getNbBytes( crealmBytes.length ) + crealmBytes.length;
             krbErrorSeqLength += 1 + TLV.getNbBytes( cRealmLength ) + cRealmLength;
         }
@@ -451,7 +451,7 @@ public class KrbError extends KerberosMe
         }
 
         // The realm
-        realmBytes = Strings.getBytesUtf8(realm);
+        realmBytes = Strings.getBytesUtf8( realm );
         realmLength = 1 + TLV.getNbBytes( realmBytes.length ) + realmBytes.length;
         krbErrorSeqLength += 1 + TLV.getNbBytes( realmLength ) + realmLength;
 
@@ -462,7 +462,7 @@ public class KrbError extends KerberosMe
         // The e-text, if any
         if ( eText != null )
         {
-            eTextBytes = Strings.getBytesUtf8(eText);
+            eTextBytes = Strings.getBytesUtf8( eText );
             eTextLength = 1 + TLV.getNbBytes( eTextBytes.length ) + eTextBytes.length;
             krbErrorSeqLength += 1 + TLV.getNbBytes( eTextLength ) + eTextLength;
         }
@@ -550,11 +550,11 @@ public class KrbError extends KerberosMe
                 // The tag
                 buffer.put( ( byte ) KerberosConstants.KRB_ERROR_CTIME_TAG );
                 buffer.put( TLV.getBytes( cTimeLength ) );
-                
+
                 // The value
-                buffer.put( (byte)UniversalTag.GENERALIZED_TIME.getValue() );
-                buffer.put( (byte)0x0F );
-                buffer.put(cTime.getBytes() );
+                buffer.put( ( byte ) UniversalTag.GENERALIZED_TIME.getValue() );
+                buffer.put( ( byte ) 0x0F );
+                buffer.put( cTime.getBytes() );
             }
 
             // cusec tag and value if any
@@ -571,8 +571,8 @@ public class KrbError extends KerberosMe
             buffer.put( TLV.getBytes( sTimeLength ) );
 
             // The value
-            buffer.put( (byte)UniversalTag.GENERALIZED_TIME.getValue() );
-            buffer.put( (byte)0x0F );
+            buffer.put( ( byte ) UniversalTag.GENERALIZED_TIME.getValue() );
+            buffer.put( ( byte ) 0x0F );
             buffer.put( sTime.getBytes() );
 
             // susec tag and value
@@ -586,7 +586,7 @@ public class KrbError extends KerberosMe
             Value.encode( buffer, errorCode.getValue() );
 
             // crealm tage and value, if any
-            if ( cRealm != null)
+            if ( cRealm != null )
             {
                 buffer.put( ( byte ) KerberosConstants.KRB_ERROR_CREALM_TAG );
                 buffer.put( TLV.getBytes( cRealmLength ) );
@@ -647,7 +647,7 @@ public class KrbError extends KerberosMe
 
         if ( IS_DEBUG )
         {
-            log.debug( "KrbError encoding : {}", Strings.dumpBytes(buffer.array()) );
+            log.debug( "KrbError encoding : {}", Strings.dumpBytes( buffer.array() ) );
             log.debug( "KrbError initial value : {}", toString() );
         }
 
@@ -701,7 +701,7 @@ public class KrbError extends KerberosMe
 
         if ( eData != null )
         {
-            sb.append( "    eData: " ).append( Strings.dumpBytes(eData) ).append( '\n' );
+            sb.append( "    eData: " ).append( Strings.dumpBytes( eData ) ).append( '\n' );
         }
 
         sb.append( "}\n" );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbPriv.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbPriv.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbPriv.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbPriv.java Tue Jan 24 16:15:05 2012
@@ -77,6 +77,7 @@ public class KrbPriv extends KerberosMes
         super( 5, KerberosMessageType.KRB_PRIV );
     }
 
+
     /**
      * @return the encPart
      */
@@ -177,7 +178,7 @@ public class KrbPriv extends KerberosMes
 
         if ( IS_DEBUG )
         {
-            log.debug( "KrbPriv encoding : {}", Strings.dumpBytes(buffer.array()) );
+            log.debug( "KrbPriv encoding : {}", Strings.dumpBytes( buffer.array() ) );
             log.debug( "KrbPriv initial value : {}", toString() );
         }
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbSafe.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbSafe.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbSafe.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbSafe.java Tue Jan 24 16:15:05 2012
@@ -118,7 +118,7 @@ public class KrbSafe extends KerberosMes
         this.checksum = checksum;
     }
 
-    
+
     /**
      * Compute the KRB-SAFE length
      * <pre>
@@ -216,14 +216,12 @@ public class KrbSafe extends KerberosMes
 
         if ( IS_DEBUG )
         {
-            log.debug( "KrbSafe encoding : {}", Strings.dumpBytes(buffer.array()) );
+            log.debug( "KrbSafe encoding : {}", Strings.dumpBytes( buffer.array() ) );
             log.debug( "KrbSafe initial value : {}", toString() );
         }
 
         return buffer;
     }
-    
-    
 
 
     /**

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsRep.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsRep.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsRep.java Tue Jan 24 16:15:05 2012
@@ -45,10 +45,11 @@ public class TgsRep extends KdcRep
     // Storage for computed lengths
     private int kdcRepLength;
 
+
     /**
      * Creates a new instance of TGS-REP.
      */
-    public TgsRep() 
+    public TgsRep()
     {
         super( KerberosMessageType.TGS_REP );
     }
@@ -64,7 +65,7 @@ public class TgsRep extends KdcRep
         return encKdcRepPart.getEndTime();
     }
 
-    
+
     /**
      * Returns the {@link TicketFlags}.
      *
@@ -107,8 +108,8 @@ public class TgsRep extends KdcRep
     {
         return encKdcRepPart.getStartTime();
     }
-    
-    
+
+
     /**
      * Returns the server {@link PrincipalName}.
      *
@@ -119,7 +120,7 @@ public class TgsRep extends KdcRep
         return encKdcRepPart.getSName();
     }
 
-    
+
     /**
      * Compute the TGS-REP length
      * <pre>
@@ -133,11 +134,11 @@ public class TgsRep extends KdcRep
     public int computeLength()
     {
         kdcRepLength = super.computeLength();
-        
+
         return 1 + TLV.getNbBytes( kdcRepLength ) + kdcRepLength;
     }
-    
-    
+
+
     /**
      * Encode the TGS-REP component
      * 
@@ -151,14 +152,14 @@ public class TgsRep extends KdcRep
         {
             buffer = ByteBuffer.allocate( computeLength() );
         }
-        
+
         // The TGS-REP SEQ Tag
-        buffer.put( (byte)KerberosConstants.TGS_REP_TAG );
+        buffer.put( ( byte ) KerberosConstants.TGS_REP_TAG );
         buffer.put( TLV.getBytes( kdcRepLength ) );
-        
+
         // The KDC-REP --------------------------------------------------------
         super.encode( buffer );
-        
+
         return buffer;
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsReq.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsReq.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsReq.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsReq.java Tue Jan 24 16:15:05 2012
@@ -43,6 +43,7 @@ public class TgsReq extends KdcReq
     private int kdcReqLength;
     private int tgsReqLength;
 
+
     /**
      * Creates a new instance of TGS-REQ.
      */
@@ -51,7 +52,7 @@ public class TgsReq extends KdcReq
         super( KerberosMessageType.TGS_REQ );
     }
 
-    
+
     /**
      * Compute the TGS-REQ length
      * <pre>
@@ -66,14 +67,14 @@ public class TgsReq extends KdcReq
     {
         kdcReqLength = 0;
         tgsReqLength = 0;
-        
+
         kdcReqLength = super.computeLength();
         tgsReqLength = 1 + TLV.getNbBytes( kdcReqLength ) + kdcReqLength;
-        
+
         return tgsReqLength;
     }
-    
-    
+
+
     /**
      * Encode the TGS-REQ component
      * 
@@ -87,14 +88,14 @@ public class TgsReq extends KdcReq
         {
             buffer = ByteBuffer.allocate( computeLength() );
         }
-        
+
         // The TGS-REQ SEQ Tag
-        buffer.put( (byte)KerberosConstants.TGS_REQ_TAG );
+        buffer.put( ( byte ) KerberosConstants.TGS_REQ_TAG );
         buffer.put( TLV.getBytes( kdcReqLength ) );
-        
+
         // The KDC-REQ --------------------------------------------------------
         super.encode( buffer );
-        
+
         return buffer;
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/Ticket.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/Ticket.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/Ticket.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/Ticket.java Tue Jan 24 16:15:05 2012
@@ -60,25 +60,25 @@ public class Ticket extends KerberosMess
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
-    
+
     /** Constant for the {@link Ticket} version number (5) */
     public static final int TICKET_VNO = KerberosConstants.KERBEROS_V5;
 
     /** A storage for a byte array representation of the realm */
     private byte[] realmBytes;
-    
+
     /** The server principal name */
     private PrincipalName sName;
-    
+
     /** The server realm */
     private String realm;
-    
+
     /** The encoded part */
     private EncryptedData encPart;
-    
+
     /** The encoded ticket part, stored in its original form (not encoded) */
     private EncTicketPart encTicketPart;
-    
+
     // Storage for computed lengths
     private int tktvnoLength;
     private int realmLength;
@@ -87,6 +87,7 @@ public class Ticket extends KerberosMess
     private int ticketSeqLength;
     private int ticketLength;
 
+
     /**
      * Creates a new instance of Ticket.
      *
@@ -108,8 +109,8 @@ public class Ticket extends KerberosMess
     {
         super( KerberosMessageType.TICKET );
     }
-    
-    
+
+
     /**
      * Creates a new instance of Ticket.
      *
@@ -135,16 +136,16 @@ public class Ticket extends KerberosMess
         return encPart;
     }
 
-    
+
     /**
      * Set the encrypted ticket part
      * @param encPart the encrypted ticket part
      */
     public void setEncPart( EncryptedData encPart )
     {
-        this.encPart = encPart; 
+        this.encPart = encPart;
     }
-    
+
 
     /**
      * Returns the server realm.
@@ -165,8 +166,8 @@ public class Ticket extends KerberosMess
     {
         this.realm = realm;
     }
-    
-    
+
+
     /**
      * Returns the server {@link PrincipalName}.
      *
@@ -177,7 +178,7 @@ public class Ticket extends KerberosMess
         return sName;
     }
 
-    
+
     /**
      * Set the server principalName
      * @param sName the server principalName
@@ -186,8 +187,8 @@ public class Ticket extends KerberosMess
     {
         this.sName = sName;
     }
-    
-    
+
+
     /**
      * Gets the Ticket Version number
      * @return The ticket version number
@@ -196,8 +197,8 @@ public class Ticket extends KerberosMess
     {
         return getProtocolVersionNumber();
     }
-    
-    
+
+
     /**
      * Sets the Ticket Version number
      * @param tktVno The new version number
@@ -206,7 +207,7 @@ public class Ticket extends KerberosMess
     {
         setProtocolVersionNumber( tktVno );
     }
-    
+
 
     /**
      * @return the encTicketPart
@@ -225,7 +226,7 @@ public class Ticket extends KerberosMess
         this.encTicketPart = encTicketPart;
     }
 
-    
+
     /**
      * Compute the Ticket length
      * <pre>
@@ -254,29 +255,29 @@ public class Ticket extends KerberosMess
         tktvnoLength = 1 + 1 + Value.getNbBytes( getProtocolVersionNumber() );
 
         // Compute the Ticket realm length.
-        realmBytes = Strings.getBytesUtf8(realm);
+        realmBytes = Strings.getBytesUtf8( realm );
         realmLength = 1 + TLV.getNbBytes( realmBytes.length ) + realmBytes.length;
 
         // Compute the principal length
         sNameLength = sName.computeLength();
-        
+
         // Compute the encrypted data
         encPartLength = encPart.computeLength();
 
         // Compute the sequence size
-        ticketSeqLength = 
+        ticketSeqLength =
             1 + TLV.getNbBytes( tktvnoLength ) + tktvnoLength +
-            1 + TLV.getNbBytes( realmLength ) + realmLength +
-            1 + TLV.getNbBytes( sNameLength ) + sNameLength + 
-            1 + TLV.getNbBytes( encPartLength ) + encPartLength;
-        
+                1 + TLV.getNbBytes( realmLength ) + realmLength +
+                1 + TLV.getNbBytes( sNameLength ) + sNameLength +
+                1 + TLV.getNbBytes( encPartLength ) + encPartLength;
+
         // compute the global size
         ticketLength = 1 + TLV.getNbBytes( ticketSeqLength ) + ticketSeqLength;
-        
+
         return 1 + TLV.getNbBytes( ticketLength ) + ticketLength;
     }
-    
-    
+
+
     /**
      * Encode the Ticket message to a PDU. 
      * <pre>
@@ -303,7 +304,7 @@ public class Ticket extends KerberosMess
         try
         {
             // The Ticket APPLICATION Tag
-            buffer.put( (byte)KerberosConstants.TICKET_TAG );
+            buffer.put( ( byte ) KerberosConstants.TICKET_TAG );
             buffer.put( TLV.getBytes( ticketLength ) );
 
             // The Ticket SEQUENCE Tag
@@ -311,43 +312,43 @@ public class Ticket extends KerberosMess
             buffer.put( TLV.getBytes( ticketSeqLength ) );
 
             // The tkt-vno Tag and value
-            buffer.put( ( byte )KerberosConstants.TICKET_TKT_VNO_TAG );
+            buffer.put( ( byte ) KerberosConstants.TICKET_TKT_VNO_TAG );
             buffer.put( TLV.getBytes( tktvnoLength ) );
             Value.encode( buffer, getProtocolVersionNumber() );
 
             // The realm Tag and value
-            buffer.put( ( byte )KerberosConstants.TICKET_REALM_TAG );
+            buffer.put( ( byte ) KerberosConstants.TICKET_REALM_TAG );
             buffer.put( TLV.getBytes( realmLength ) );
             buffer.put( UniversalTag.GENERAL_STRING.getValue() );
             buffer.put( TLV.getBytes( realmBytes.length ) );
             buffer.put( realmBytes );
 
             // The sname Tag and value
-            buffer.put( ( byte )KerberosConstants.TICKET_SNAME_TAG );
+            buffer.put( ( byte ) KerberosConstants.TICKET_SNAME_TAG );
             buffer.put( TLV.getBytes( sNameLength ) );
             sName.encode( buffer );
-            
+
             // The encPartLength Tag and value
-            buffer.put( ( byte )KerberosConstants.TICKET_ENC_PART_TAG );
+            buffer.put( ( byte ) KerberosConstants.TICKET_ENC_PART_TAG );
             buffer.put( TLV.getBytes( encPartLength ) );
             encPart.encode( buffer );
         }
         catch ( BufferOverflowException boe )
         {
-            LOG.error( I18n.err( I18n.ERR_137, 1 + TLV.getNbBytes( ticketLength ) + ticketLength, 
+            LOG.error( I18n.err( I18n.ERR_137, 1 + TLV.getNbBytes( ticketLength ) + ticketLength,
                 buffer.capacity() ) );
             throw new EncoderException( I18n.err( I18n.ERR_138 ) );
         }
 
         if ( IS_DEBUG )
         {
-            LOG.debug( "Ticket encoding : {}", Strings.dumpBytes(buffer.array()) );
+            LOG.debug( "Ticket encoding : {}", Strings.dumpBytes( buffer.array() ) );
             LOG.debug( "Ticket initial value : {}", toString() );
         }
 
         return buffer;
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -374,14 +375,14 @@ public class Ticket extends KerberosMess
         {
             return true;
         }
-        
+
         if ( obj == null )
         {
             return false;
         }
-        
+
         Ticket other = ( Ticket ) obj;
-        
+
         if ( encPart == null )
         {
             if ( other.encPart != null )
@@ -393,7 +394,7 @@ public class Ticket extends KerberosMess
         {
             return false;
         }
-        
+
         if ( realm == null )
         {
             if ( other.realm != null )
@@ -405,7 +406,7 @@ public class Ticket extends KerberosMess
         {
             return false;
         }
-        
+
         if ( sName == null )
         {
             if ( other.sName != null )
@@ -417,7 +418,7 @@ public class Ticket extends KerberosMess
         {
             return false;
         }
-        
+
         return true;
     }
 
@@ -428,13 +429,13 @@ public class Ticket extends KerberosMess
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( "Ticket :\n" );
         sb.append( "  tkt-vno : " ).append( getProtocolVersionNumber() ).append( "\n" );
         sb.append( "  realm : " ).append( realm ).append( "\n" );
         sb.append( "  sname : " ).append( sName ).append( "\n" );
         sb.append( "  enc-part : " ).append( encPart ).append( "\n" );
-        
+
         return sb.toString();
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/KerberosUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/KerberosUtilsTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/KerberosUtilsTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/KerberosUtilsTest.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.server.kerberos.shared;
 
+
 import static org.junit.Assert.assertEquals;
 
 import java.util.List;
@@ -32,6 +33,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.apache.directory.shared.kerberos.KerberosUtils;
 
+
 /**
  * Test the KerberosUtils class
  *
@@ -49,18 +51,18 @@ public class KerberosUtilsTest
         System.setProperty( "java.security.krb5.kdc", "localhost" );
     }
 
-    
+
     @Test
     public void testKerberosNameSimple() throws Exception
     {
         KerberosPrincipal kp = new KerberosPrincipal( "abc" );
         List<String> names = KerberosUtils.getNames( kp );
-     
+
         assertEquals( 1, names.size() );
         assertEquals( "abc", names.get( 0 ) );
     }
 
-    
+
     /**
     public void testKerberosNameEscaped() throws Exception
     {
@@ -74,43 +76,42 @@ public class KerberosUtilsTest
     }
     */
 
-
     @Test
     public void testKerberosNameSimpleWithRealm() throws Exception
     {
         KerberosPrincipal kp = new KerberosPrincipal( "abc@APACHE.ORG" );
         List<String> names = KerberosUtils.getNames( kp );
-     
+
         assertEquals( 1, names.size() );
         assertEquals( "abc", names.get( 0 ) );
     }
-    
+
+
     @Test
     public void testKerberosNameThree() throws Exception
     {
         KerberosPrincipal kp = new KerberosPrincipal( "abc/def/ghi" );
         List<String> names = KerberosUtils.getNames( kp );
-     
+
         assertEquals( 3, names.size() );
         assertEquals( "abc", names.get( 0 ) );
         assertEquals( "def", names.get( 1 ) );
         assertEquals( "ghi", names.get( 2 ) );
     }
 
+
     @Test
     public void testKerberosNameThreeWithRealm() throws Exception
     {
         KerberosPrincipal kp = new KerberosPrincipal( "abc/def/ghi@APACHE.ORG" );
         List<String> names = KerberosUtils.getNames( kp );
-     
+
         assertEquals( 3, names.size() );
         assertEquals( "abc", names.get( 0 ) );
         assertEquals( "def", names.get( 1 ) );
         assertEquals( "ghi", names.get( 2 ) );
     }
 
-
-    
     /*
     public void testKerberosEndingSlash()
     {
@@ -128,8 +129,7 @@ public class KerberosUtilsTest
         }
     }
     */
-    
-    
+
     /*
     public void testKerberosEndingSlashWithRealm()
     {

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesEncryptionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesEncryptionTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesEncryptionTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesEncryptionTest.java Tue Jan 24 16:15:05 2012
@@ -37,6 +37,7 @@ import org.junit.runner.RunWith;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+
 /**
  * Tests the use of AES for Kerberos, using test vectors from RFC 3962,
  * "Advanced Encryption Standard (AES) Encryption for Kerberos 5."

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java Tue Jan 24 16:15:05 2012
@@ -192,7 +192,7 @@ public class CipherTextHandlerTest
         try
         {
             byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
-            PaEncTsEnc object =  KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
+            PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
             assertEquals( "TimeStamp", "20070410190400Z", object.getPaTimestamp().toString() );
             assertEquals( "MicroSeconds", 460450, object.getPausec() );
         }
@@ -438,7 +438,7 @@ public class CipherTextHandlerTest
     protected PaEncTsEnc getEncryptedTimeStamp( String zuluTime, int microSeconds ) throws ParseException
     {
         Date date = null;
-        
+
         synchronized ( DateUtils.DATE_FORMAT )
         {
             date = DateUtils.DATE_FORMAT.parse( zuluTime );

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java Tue Jan 24 16:15:05 2012
@@ -44,6 +44,7 @@ import org.junit.runner.RunWith;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+
 /**
  * Test cases for the encryption types used by Kerberos "5.2" per RFC 4120,
  * "The Kerberos Network Authentication Service (V5)."
@@ -291,12 +292,12 @@ public class KeyTypeTest
         Set<String> result = new HashSet<String>();
 
         Provider[] providers = Security.getProviders();
-        
+
         for ( Provider provider : providers )
         {
             // Get services provided by each provider
             Set<Object> keys = provider.keySet();
-            
+
             for ( Object keyObject : keys )
             {
                 String key = ( String ) keyObject;

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/RandomKeyFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/RandomKeyFactoryTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/RandomKeyFactoryTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/RandomKeyFactoryTest.java Tue Jan 24 16:15:05 2012
@@ -38,6 +38,7 @@ import org.apache.directory.shared.kerbe
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Test cases for random-to-key functions for DES-, DES3-, AES-, and RC4-based
  * encryption types.

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.server.kerberos.shared.crypto.encryption;
 
+
 import org.apache.directory.shared.util.Strings;
 
 

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java Tue Jan 24 16:15:05 2012
@@ -164,7 +164,7 @@ public class KeytabTest
 
         String zuluTime = "20070217235745Z";
         Date date = null;
-        
+
         synchronized ( DateUtils.DATE_FORMAT )
         {
             date = DateUtils.DATE_FORMAT.parse( zuluTime );



Mime
View raw message