[Opendnssec-user] Opendnssec signer Y2K bug?

Miek Gieben miek at miek.nl
Fri Dec 23 10:58:33 UTC 2011


[ Quoting <rickard at opendnssec.org> at 11:56 on Dec 23 in "Re: [Opendnssec-user..." ]
> > OpenDNSSEC uses ldns to write the information to the signed zone file.
> > This is why you got the weird time stamp in your zone file.
> 
> ldns handles times differently depending on the architecture, but
> OpenDNSSEC only use time_t.
> 
> struct tm *
> ldns_serial_arithmitics_gmtime_r(int32_t time, time_t now, struct tm *result)
> {
> #if SIZEOF_TIME_T <= 4
>         int64_t secs_since_epoch = ldns_serial_arithmitics_time(time, now);
>         return  ldns_gmtime64_r(secs_since_epoch, result);
> #else
>         time_t  secs_since_epoch = ldns_serial_arithmitics_time(time, now);
>         return  gmtime_r(&secs_since_epoch, result);
> #endif
> }

Looking at exactly the same code :-) slightly above this function (in util.c)
there is:

    static int64_t
    ldns_serial_arithmitics_time(int32_t time, time_t now)
    {
             int32_t offset = time - (int32_t) now;
             return (int64_t) now + offset;
    }

Casting it back to an int64_t should be OK even on 32 bits...

grtz Miek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.opendnssec.org/pipermail/opendnssec-user/attachments/20111223/19fe362c/attachment.bin>


More information about the Opendnssec-user mailing list