[gnutls-devel] GnuTLS | Issue with GNUTLS_X509_NO_WELL_DEFINED_EXPIRATION (#609)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Wed Nov 7 10:27:03 CET 2018


Something like the following should be sufficient, in addition to a testsuite check.
```
diff --git a/lib/x509/time.c b/lib/x509/time.c
index 4d2b78926..b3d799400 100644
--- a/lib/x509/time.c
+++ b/lib/x509/time.c
@@ -238,7 +238,7 @@ gtime_to_suitable_time(time_t gtime, char *str_time, size_t str_time_size, unsig
        size_t ret;
        struct tm _tm;
 
-       if (gtime == (time_t)-1
+       if (gtime == GNUTLS_X509_NO_WELL_DEFINED_EXPIRATION || gtime == (time_t)-1
 #if SIZEOF_LONG == 8
                || gtime >= 253402210800
 #endif
@@ -277,7 +277,7 @@ gtime_to_generalTime(time_t gtime, char *str_time, size_t str_time_size)
        size_t ret;
        struct tm _tm;
        
-       if (gtime == (time_t)-1
+       if (gtime == GNUTLS_X509_NO_WELL_DEFINED_EXPIRATION || gtime == (time_t)-1
 #if SIZEOF_LONG == 8
                || gtime >= 253402210800
 #endif
@@ -409,6 +409,7 @@ _gnutls_x509_set_time(ASN1_TYPE c2, const char *where, time_t tim,
```

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/issues/609#note_115116078
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20181107/34b61182/attachment.html>


More information about the Gnutls-devel mailing list