summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-03-16 23:26:30 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-03-16 23:45:15 +0100
commit8a5918561dea2e7f831b1515294fa2ab0b7ddab3 (patch)
treee2bef1a7632518b4fe1fd36fd9d5152c75e433a7
parent6edc24318bbba76ca16ac3aa89ec6a0e1d68bdaa (diff)
downloadgnutls-8a5918561dea2e7f831b1515294fa2ab0b7ddab3.tar.gz
Handle dates before 1-1-1970 (handle as being equal to 1-1-1970).
-rw-r--r--lib/x509/common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/x509/common.c b/lib/x509/common.c
index f85e0ee4f9..f8fee2f563 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -458,6 +458,9 @@ _gnutls_x509_time2gtime (const char *ttime, int year)
if (sizeof (time_t) <= 4 && etime.tm_year >= 2038)
return (time_t) 2145914603; /* 2037-12-31 23:23:23 */
+ if (etime.tm_year < 1970)
+ return (time_t) 0;
+
xx[2] = 0;
/* get the month