Blame doc/appdev/y2038.rst

Packit fd8b60
Year 2038 considerations for uses of krb5_timestamp
Packit fd8b60
===================================================
Packit fd8b60
Packit fd8b60
POSIX time values, which measure the number of seconds since January 1
Packit fd8b60
1970, will exceed the maximum value representable in a signed 32-bit
Packit fd8b60
integer in January 2038.  This documentation describes considerations
Packit fd8b60
for consumers of the MIT krb5 libraries.
Packit fd8b60
Packit fd8b60
Applications or libraries which use libkrb5 and consume the timestamps
Packit fd8b60
included in credentials or other structures make use of the
Packit fd8b60
:c:type:`krb5_timestamp` type.  For historical reasons, krb5_timestamp
Packit fd8b60
is a signed 32-bit integer, even on platforms where a larger type is
Packit fd8b60
natively used to represent time values.  To behave properly for time
Packit fd8b60
values after January 2038, calling code should cast krb5_timestamp
Packit fd8b60
values to uint32_t, and then to time_t::
Packit fd8b60
Packit fd8b60
    (time_t)(uint32_t)timestamp
Packit fd8b60
Packit fd8b60
Used in this way, krb5_timestamp values can represent time values up
Packit fd8b60
until February 2106, provided that the platform uses a 64-bit or
Packit fd8b60
larger time_t type.  This usage will also remain safe if a later
Packit fd8b60
version of MIT krb5 changes krb5_timestamp to an unsigned 32-bit
Packit fd8b60
integer.
Packit fd8b60
Packit fd8b60
The GSSAPI only uses representations of time intervals, not absolute
Packit fd8b60
times.  Callers of the GSSAPI should require no changes to behave
Packit fd8b60
correctly after January 2038, provided that they use MIT krb5 release
Packit fd8b60
1.16 or later.