directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1043805 [3/3] - in /directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory: server/ server/kerberos/ server/kerberos/protocol/ server/kerberos/shared/ server/kerberos/shared/crypto/ server/kerberos/shared/crypto/checksu...
Date Thu, 09 Dec 2010 00:38:25 GMT
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=1043805&r1=1043804&r2=1043805&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
Thu Dec  9 00:38:21 2010
@@ -26,7 +26,10 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.KerberosMessageType;
+import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.components.KdcRep;
+import org.apache.directory.shared.kerberos.components.PrincipalName;
+import org.apache.directory.shared.kerberos.flags.TicketFlags;
 
 
 /**
@@ -41,7 +44,6 @@ public class TgsRep extends KdcRep
 {
     // Storage for computed lengths
     private transient int kdcRepLength;
-    private transient int tgsRepLength;
 
     /**
      * Creates a new instance of TGS-REP.
@@ -51,6 +53,72 @@ public class TgsRep extends KdcRep
         super( KerberosMessageType.TGS_REP );
     }
 
+
+    /**
+     * Returns the end {@link KerberosTime}.
+     *
+     * @return The end {@link KerberosTime}.
+     */
+    public KerberosTime getEndTime()
+    {
+        return encKdcRepPart.getEndTime();
+    }
+
+    
+    /**
+     * Returns the {@link TicketFlags}.
+     *
+     * @return The {@link TicketFlags}.
+     */
+    public TicketFlags getFlags()
+    {
+        return encKdcRepPart.getFlags();
+    }
+
+
+    /**
+     * Returns the nonce.
+     *
+     * @return The nonce.
+     */
+    public int getNonce()
+    {
+        return encKdcRepPart.getNonce();
+    }
+
+
+    /**
+     * Returns the renew till {@link KerberosTime}.
+     *
+     * @return The renew till {@link KerberosTime}.
+     */
+    public KerberosTime getRenewTill()
+    {
+        return encKdcRepPart.getRenewTill();
+    }
+
+
+    /**
+     * Returns the start {@link KerberosTime}.
+     *
+     * @return The start {@link KerberosTime}.
+     */
+    public KerberosTime getStartTime()
+    {
+        return encKdcRepPart.getStartTime();
+    }
+    
+    
+    /**
+     * Returns the server {@link PrincipalName}.
+     *
+     * @return The server {@link PrincipalName}.
+     */
+    public PrincipalName getSName()
+    {
+        return encKdcRepPart.getSName();
+    }
+
     
     /**
      * Compute the TGS-REP length
@@ -65,9 +133,8 @@ public class TgsRep extends KdcRep
     public int computeLength()
     {
         kdcRepLength = super.computeLength();
-        tgsRepLength = 1 + TLV.getNbBytes( kdcRepLength ) + kdcRepLength;
         
-        return tgsRepLength;
+        return 1 + TLV.getNbBytes( kdcRepLength ) + kdcRepLength;
     }
     
     
@@ -87,7 +154,7 @@ public class TgsRep extends KdcRep
         
         // The TGS-REP SEQ Tag
         buffer.put( (byte)KerberosConstants.TGS_REP_TAG );
-        buffer.put( TLV.getBytes( tgsRepLength ) );
+        buffer.put( TLV.getBytes( kdcRepLength ) );
         
         // The KDC-REP --------------------------------------------------------
         super.encode( 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=1043805&r1=1043804&r2=1043805&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
Thu Dec  9 00:38:21 2010
@@ -30,6 +30,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.KerberosMessageType;
+import org.apache.directory.shared.kerberos.components.EncTicketPart;
 import org.apache.directory.shared.kerberos.components.EncryptedData;
 import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.kerberos.exceptions.InvalidTicketException;
@@ -37,8 +38,6 @@ import org.apache.directory.shared.ldap.
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import sun.security.krb5.internal.EncTicketPart;
-
 
 /**
  * Ticket message component as handed out by the ticket granting service. It will store
@@ -77,9 +76,9 @@ public class Ticket extends KerberosMess
     /** The encoded part */
     private EncryptedData encPart;
     
-    /** The decoded ticket part */
-    private EncTicketPart encTicketPart;
-
+    /** The encoded ticket part, stored in its original form (not encoded) */
+    private transient EncTicketPart encTicketPart;
+    
     // Storage for computed lengths
     private transient int tktvnoLength;
     private transient int realmLength;
@@ -210,6 +209,24 @@ public class Ticket extends KerberosMess
     
 
     /**
+     * @return the encTicketPart
+     */
+    public EncTicketPart getEncTicketPart()
+    {
+        return encTicketPart;
+    }
+
+
+    /**
+     * @param encTicketPart the encTicketPart to set
+     */
+    public void setEncTicketPart( EncTicketPart encTicketPart )
+    {
+        this.encTicketPart = encTicketPart;
+    }
+
+    
+    /**
      * Compute the Ticket length
      * <pre>
      * Ticket :



Mime
View raw message