summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-16 09:33:58 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-16 10:39:41 +0100
commit9964b2c469f4ca34deae6e8af220e5bbb8983600 (patch)
tree561453d0d9352247eb0932db8dd45fb1635144d5
parentf200f380c8684d3a96d4233c8f7b5a4d6bc1b716 (diff)
downloadgnutls-9964b2c469f4ca34deae6e8af220e5bbb8983600.tar.gz
An expiration time of (time_t)-1 will set to the no well-defined expiration date value.
-rw-r--r--lib/x509/common.c6
-rw-r--r--lib/x509/x509_write.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/x509/common.c b/lib/x509/common.c
index ee8478dc99..e94efcd0ee 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -727,6 +727,12 @@ gtime2generalTime (time_t gtime, char *str_time, size_t str_time_size)
{
size_t ret;
struct tm _tm;
+
+ if (gtime == (time_t)-1)
+ {
+ snprintf(str_time, str_time_size, "99991231235959Z");
+ return 0;
+ }
if (!gmtime_r (&gtime, &_tm))
{
diff --git a/lib/x509/x509_write.c b/lib/x509/x509_write.c
index c5e854e71c..c9ade9ff3a 100644
--- a/lib/x509/x509_write.c
+++ b/lib/x509/x509_write.c
@@ -909,6 +909,8 @@ gnutls_x509_crt_set_activation_time (gnutls_x509_crt_t cert, time_t act_time)
* @exp_time: The actual time
*
* This function will set the time this Certificate will expire.
+ * Setting an expiration time of (time_t)-1 will set to the
+ * no well-defined expiration date value.
*
* Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise a
* negative error value.