]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Applied patch to cast days to (time_t) before converting it to
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 17 Mar 2012 12:25:50 +0000 (13:25 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 17 Mar 2012 12:28:02 +0000 (13:28 +0100)
seconds to prevent a Y2K38 bug. Patch by Robert Millan.

NEWS
src/certtool.c

diff --git a/NEWS b/NEWS
index 490660d86e060b70ee31bf5fd2cf2b428cb15833..e212072c1e33b0d748d774611040fbadff26ee3d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,15 @@ GnuTLS NEWS -- History of user-visible changes.                -*- outline -*-
 Copyright (C) 2000-2012 Free Software Foundation, Inc.
 See the end for copying conditions.
 
+* Version 3.0.18 (unreleased)
+
+** certtool: Avoid a Y2K38 bug when generating certificates.
+Patch by Robert Millan.
+
+** API and ABI modifications:
+No changes since last version.
+
+
 * Version 3.0.17 (released 2012-03-17)
 
 ** command line apps: Always link with local libopts.
index df2303304fa87bcc37019f50c97ce059569a7f50..0c4ed9aa18fdcb35a7f25416196be06d23d13eee 100644 (file)
@@ -417,7 +417,7 @@ generate_certificate (gnutls_privkey_t * ret_key,
 
   result =
     gnutls_x509_crt_set_expiration_time (crt,
-                                         time (NULL) + days * 24 * 60 * 60);
+                                         time (NULL) + ((time_t) days) * 24 * 60 * 60);
   if (result < 0)
     error (EXIT_FAILURE, 0, "set_expiration: %s", gnutls_strerror (result));
 
@@ -933,7 +933,7 @@ update_signed_certificate (common_info_st * cinfo)
   days = get_days ();
 
   result =
-    gnutls_x509_crt_set_expiration_time (crt, tim + days * 24 * 60 * 60);
+    gnutls_x509_crt_set_expiration_time (crt, tim + ((time_t) days) * 24 * 60 * 60);
   if (result < 0)
     error (EXIT_FAILURE, 0, "set_expiration: %s", gnutls_strerror (result));