directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1042607 - /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:34:21 GMT
Author: elecharny
Date: Mon Dec  6 12:34:21 2010
New Revision: 1042607

URL: http://svn.apache.org/viewvc?rev=1042607&view=rev
Log:
The kerberosTime is internally represented using ms, not seconds

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=1042607&r1=1042606&r2=1042607&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:34:21 2010
@@ -133,7 +133,7 @@ public class KerberosTime implements Com
             this.date = sdf.format( calendar.getTime() );
         }
         
-        kerberosTime = ( calendar.getTimeInMillis() / 1000 ); // drop the milliseconds
+        kerberosTime = (calendar.getTimeInMillis()/1000L)*1000L; // drop the ms
     }
     
 
@@ -247,7 +247,8 @@ public class KerberosTime implements Com
     public boolean isInClockSkew( long clockSkew )
     {
         // The KerberosTime does not have milliseconds
-        long delta = Math.abs( kerberosTime - System.currentTimeMillis()/1000L );
+        long delta = Math.abs( kerberosTime - System.currentTimeMillis() );
+        
         return delta < clockSkew;
     }
     



Mime
View raw message