Size of time_t in gnutls4win

Tim Kosse tim.kosse at filezilla-project.org
Fri Jun 19 21:40:56 CEST 2009


The Windows GnuTLS binaries from http://josefsson.org/gnutls4win/ seem
to be compiled in an environment with a 32bit time_t at least in 2.6.4
and 2.8.1, the versions I have tried.

I'm using Visual Studio 2008 and on that platform time_t is 64bit in size.

The GnuTLS functions that have a time_t either as argument or as return
type thus have undefined behavior.

For example gnutls_x509_crt_get_expiration_time from the DLL returns a
32bit number, whereas the calling program expects a 64bit number. The
result is that the leading 32 bits of the value after the call are
whatever else was on the stack at the time of the call.

The behavior of functions expecting a time_t as argument will probably
be even more problematic.

I think instead of time_t a type should be used that's been chosen at
compile time of GnUTLS to match the size of time_t of the build environment.

Regards,
Tim Kosse

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20090619/12ff2ed5/attachment.pgp>


More information about the Gnutls-devel mailing list