[6425] in Kerberos

home help back first fref pref prev next nref lref last post

Re: Kerberos 5 and the new year

daemon@ATHENA.MIT.EDU (Theodore Ts'o)
Tue Jan 2 18:14:49 1996

Date: Tue, 2 Jan 1996 17:57:41 -0500
From: Theodore Ts'o <tytso@MIT.EDU>
To: DaVe <mccomb@interport.net>
Cc: svm@netcom.com, kerberos@MIT.EDU
In-Reply-To: DaVe's message of Tue, 2 Jan 1996 17:51:02 -0500 (EST),
	<Pine.SUN.3.91.960102174954.2662A-100000@interport.net>

   Date: Tue, 2 Jan 1996 17:51:02 -0500 (EST)
   From: DaVe <mccomb@interport.net>

   There's a code problem.  The authors hard-coded the number of days in a 
   year as 365 -- not too good for leap years like 1996.

Nope, not quite.  There was a fence-post bug in the ASN.1 code; this bug
was fixed in Krb5 beta 5, but it was not fixed in the Beta 4
distribution.  My understanding is that some commercial versions of
Kerberos V5 which are based on Beta 4 or before also exhibit this bug.
The fix is relatively simple:

*** /tmp/,RCSt1a24109	Sun Dec 31 15:57:50 1995
--- gmt_mktime.c	Sun Dec 31 15:49:32 1995
***************
*** 60,66 ****
    accum *= 365;			/* 365 days/normal year */
  
    /* add in leap day for all previous years */
!   accum += (t->tm_year - 68) / 4;
    /* add in leap day for this year */
    if(t->tm_mon >= 2)		/* march or later */
      if(hasleapday(t->tm_year)) accum += 1;
--- 62,68 ----
    accum *= 365;			/* 365 days/normal year */
  
    /* add in leap day for all previous years */
!   accum += (t->tm_year - 69) / 4;
    /* add in leap day for this year */
    if(t->tm_mon >= 2)		/* march or later */
      if(hasleapday(t->tm_year)) accum += 1;

						- Ted

home help back first fref pref prev next nref lref last post