directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1034520 - in /directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos: KerberosConstants.java components/Checksum.java
Date Fri, 12 Nov 2010 19:02:31 GMT
Author: kayyagari
Date: Fri Nov 12 19:02:31 2010
New Revision: 1034520

URL: http://svn.apache.org/viewvc?rev=1034520&view=rev
Log:
o added tag constants for Checksum

Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosConstants.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosConstants.java?rev=1034520&r1=1034519&r2=1034520&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosConstants.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosConstants.java
Fri Nov 12 19:02:31 2010
@@ -53,6 +53,10 @@ public class KerberosConstants
     public static final int AUTHORIZATION_DATA_ADTYPE_TAG = 0xA0;
     public static final int AUTHORIZATION_DATA_ADDATA_TAG = 0xA1;
 
+    /** Checksum tags */
+    public static final int CHECKSUM_TYPE_TAG = 0xA0;
+    public static final int CHECKSUM_CHECKSUM_TAG = 0xA1;
+
     /** KRB-REQ-BODY's tags */
     public static final int KDC_REQ_BODY_KDC_OPTIONS_TAG = 0xA0;
     public static final int KDC_REQ_BODY_CNAME_TAG = 0xA1;

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java?rev=1034520&r1=1034519&r2=1034520&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java
Fri Nov 12 19:02:31 2010
@@ -30,6 +30,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.asn1.codec.EncoderException;
+import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.crypto.checksum.ChecksumType;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -192,7 +193,7 @@ public class Checksum extends AbstractAs
     public int computeLength()
     {
         // Compute the checksulType. The Length will always be contained in 1 byte
-        checksumTypeLength = 1 + 1 + Value.getNbBytes( cksumtype.getOrdinal() );
+        checksumTypeLength = 1 + 1 + Value.getNbBytes( cksumtype.getValue() );
         checksumLength = 1 + TLV.getNbBytes( checksumTypeLength ) + checksumTypeLength;
 
         // Compute the checksum Value
@@ -244,12 +245,12 @@ public class Checksum extends AbstractAs
             buffer.put( TLV.getBytes( checksumLength ) );
 
             // The cksumtype, first the tag, then the value
-            buffer.put( ( byte ) 0xA0 );
+            buffer.put( ( byte ) KerberosConstants.CHECKSUM_TYPE_TAG );
             buffer.put( TLV.getBytes( checksumTypeLength ) );
-            Value.encode( buffer, cksumtype.getOrdinal() );
+            Value.encode( buffer, cksumtype.getValue() );
 
             // The checksum, first the tag, then the value
-            buffer.put( ( byte ) 0xA1 );
+            buffer.put( ( byte ) KerberosConstants.CHECKSUM_CHECKSUM_TAG );
             buffer.put( TLV.getBytes( checksumBytesLength ) );
             Value.encode( buffer, checksum );
         }



Mime
View raw message