directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1043278 - in /directory/apacheds/branches/apacheds-kerberos-codec-2.0: kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/ kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ protocol-kerbe...
Date Wed, 08 Dec 2010 02:07:58 GMT
Author: elecharny
Date: Wed Dec  8 02:07:58 2010
New Revision: 1043278

URL: http://svn.apache.org/viewvc?rev=1043278&view=rev
Log:
Moved the store for encKdcrepPat to the KdcRep class, so that the AsRep and TgsRep can access
to this data structure as well.

Modified:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsRep.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java?rev=1043278&r1=1043277&r2=1043278&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
Wed Dec  8 02:07:58 2010
@@ -71,6 +71,9 @@ public class KdcRep extends KerberosMess
     
     /** Encoded part */
     private EncryptedData encPart;
+    
+    /** The decoded KDC-REP part */
+    protected EncKdcRepPart encKdcRepPart;
 
     // Storage for computed lengths
     private transient int pvnoLength;
@@ -215,6 +218,24 @@ public class KdcRep extends KerberosMess
 
     
     /**
+     * @return the encKdcRepPart
+     */
+    public EncKdcRepPart getEncKdcRepPart()
+    {
+        return encKdcRepPart;
+    }
+
+
+    /**
+     * @param encKdcRepPart the encKdcRepPart to set
+     */
+    public void setEncKdcRepPart( EncKdcRepPart encKdcRepPart )
+    {
+        this.encKdcRepPart = encKdcRepPart;
+    }
+
+    
+    /**
      * Compute the KDC-REP length
      * <pre>
      * KDC-REP :

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java?rev=1043278&r1=1043277&r2=1043278&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/AsRep.java
Wed Dec  8 02:07:58 2010
@@ -27,7 +27,6 @@ import org.apache.directory.shared.asn1.
 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.EncKdcRepPart;
 import org.apache.directory.shared.kerberos.components.KdcRep;
 import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.kerberos.flags.TicketFlags;
@@ -43,9 +42,6 @@ import org.apache.directory.shared.kerbe
  */
 public class AsRep extends KdcRep
 {
-    /** The decoded KDC-REP part */
-    private EncKdcRepPart encKdcRepPart;
-    
     // Storage for computed lengths
     private transient int kdcRepLength;
     private transient int asRepLength;
@@ -126,24 +122,6 @@ public class AsRep extends KdcRep
 
 
     /**
-     * @return the encKdcRepPart
-     */
-    public EncKdcRepPart getEncKdcRepPart()
-    {
-        return encKdcRepPart;
-    }
-
-
-    /**
-     * @param encKdcRepPart the encKdcRepPart to set
-     */
-    public void setEncKdcRepPart( EncKdcRepPart encKdcRepPart )
-    {
-        this.encKdcRepPart = encKdcRepPart;
-    }
-
-
-    /**
      * Compute the AS-REP length
      * <pre>
      * AS-REP :

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsRep.java?rev=1043278&r1=1043277&r2=1043278&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsRep.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/TgsRep.java
Wed Dec  8 02:07:58 2010
@@ -27,7 +27,6 @@ import org.apache.directory.shared.asn1.
 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.EncKdcRepPart;
 import org.apache.directory.shared.kerberos.components.KdcRep;
 import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.kerberos.flags.TicketFlags;
@@ -43,9 +42,6 @@ import org.apache.directory.shared.kerbe
  */
 public class TgsRep extends KdcRep
 {
-    /** The decoded KDC-REP part */
-    private EncKdcRepPart encPart;
-    
     // Storage for computed lengths
     private transient int kdcRepLength;
 
@@ -65,7 +61,7 @@ public class TgsRep extends KdcRep
      */
     public KerberosTime getEndTime()
     {
-        return encPart.getEndTime();
+        return encKdcRepPart.getEndTime();
     }
 
     
@@ -76,7 +72,7 @@ public class TgsRep extends KdcRep
      */
     public TicketFlags getFlags()
     {
-        return encPart.getFlags();
+        return encKdcRepPart.getFlags();
     }
 
 
@@ -87,7 +83,7 @@ public class TgsRep extends KdcRep
      */
     public int getNonce()
     {
-        return encPart.getNonce();
+        return encKdcRepPart.getNonce();
     }
 
 
@@ -98,7 +94,7 @@ public class TgsRep extends KdcRep
      */
     public KerberosTime getRenewTill()
     {
-        return encPart.getRenewTill();
+        return encKdcRepPart.getRenewTill();
     }
 
 
@@ -109,7 +105,7 @@ public class TgsRep extends KdcRep
      */
     public KerberosTime getStartTime()
     {
-        return encPart.getStartTime();
+        return encKdcRepPart.getStartTime();
     }
     
     
@@ -120,7 +116,7 @@ public class TgsRep extends KdcRep
      */
     public PrincipalName getSName()
     {
-        return encPart.getSName();
+        return encKdcRepPart.getSName();
     }
 
     

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java?rev=1043278&r1=1043277&r2=1043278&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
Wed Dec  8 02:07:58 2010
@@ -440,6 +440,7 @@ public class TicketGrantingService
         }
         
         reply.setEncPart( encryptedData );
+        reply.setEncKdcRepPart( encKdcRepPart );
 
         tgsContext.setReply( reply );
     }
@@ -1065,13 +1066,16 @@ public class TicketGrantingService
         KerberosTime clientTime = authenticator.getCtime();
         int clientMicroSeconds = authenticator.getCusec();
 
-        if ( replayCache.isReplay( serverPrincipal, clientPrincipal, clientTime, clientMicroSeconds
) )
+        if ( replayCache != null )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_REPEAT );
+            if ( replayCache.isReplay( serverPrincipal, clientPrincipal, clientTime, clientMicroSeconds
) )
+            {
+                throw new KerberosException( ErrorType.KRB_AP_ERR_REPEAT );
+            }
+    
+            replayCache.save( serverPrincipal, clientPrincipal, clientTime, clientMicroSeconds
);
         }
 
-        replayCache.save( serverPrincipal, clientPrincipal, clientTime, clientMicroSeconds
);
-
         if ( !authenticator.getCtime().isInClockSkew( clockSkew ) )
         {
             throw new KerberosException( ErrorType.KRB_AP_ERR_SKEW );



Mime
View raw message