directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1042604 - /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosTime.java
Date Mon, 06 Dec 2010 12:21:23 GMT
Author: elecharny
Date: Mon Dec  6 12:21:23 2010
New Revision: 1042604

URL: http://svn.apache.org/viewvc?rev=1042604&view=rev
Log:
Fix the clockSkew computation

Modified:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosTime.java

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosTime.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/KerberosTime.java?rev=1042604&r1=1042603&r2=1042604&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosTime.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosTime.java
Mon Dec  6 12:21:23 2010
@@ -246,7 +246,9 @@ public class KerberosTime implements Com
      */
     public boolean isInClockSkew( long clockSkew )
     {
-        return Math.abs( kerberosTime - System.currentTimeMillis() ) < clockSkew;
+        // The KerberosTime does not have milliseconds
+        long delta = Math.abs( kerberosTime - System.currentTimeMillis()/1000L );
+        return delta < clockSkew;
     }
     
     



Mime
View raw message