aboutsummaryrefslogtreecommitdiff
path: root/ssl
diff options
context:
space:
mode:
authorJ.W. Jagersma <jwjagersma@gmail.com>2022-12-02 19:27:37 +0100
committerPauli <pauli@openssl.org>2022-12-08 11:09:12 +1100
commitafec90df259be3002dfc605593f6e31b194f37b6 (patch)
treecdbc678996ddf1fa600692fc2b540d0985d53004 /ssl
parent2a2100329839699b915432cfb1e8276b6ccb26bc (diff)
downloadopenssl-afec90df259be3002dfc605593f6e31b194f37b6.zip
openssl-afec90df259be3002dfc605593f6e31b194f37b6.tar.gz
openssl-afec90df259be3002dfc605593f6e31b194f37b6.tar.bz2
Fix warnings with unsigned time_t
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19843)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_sess.c4
-rw-r--r--ssl/statem/extensions_srvr.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index 68b57a5..f065f2f 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -59,9 +59,11 @@ __owur static int timeoutcmp(SSL_SESSION *a, SSL_SESSION *b)
*/
void ssl_session_calculate_timeout(SSL_SESSION *ss)
{
+#ifndef __DJGPP__ /* time_t is unsigned on djgpp */
/* Force positive timeout */
if (ss->timeout < 0)
ss->timeout = 0;
+#endif
ss->calc_timeout = ss->time + ss->timeout;
/*
* |timeout| is always zero or positive, so the check for
@@ -70,7 +72,7 @@ void ssl_session_calculate_timeout(SSL_SESSION *ss)
ss->timeout_ovf = ss->time > 0 && ss->calc_timeout < ss->time;
/*
* N.B. Realistic overflow can only occur in our lifetimes on a
- * 32-bit machine in January 2038.
+ * 32-bit machine with signed time_t, in January 2038.
* However, There are no controls to limit the |timeout|
* value, except to keep it positive.
*/
diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c
index 16765a5..00b1ee5 100644
--- a/ssl/statem/extensions_srvr.c
+++ b/ssl/statem/extensions_srvr.c
@@ -1147,7 +1147,7 @@ int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
* rounding errors.
*/
if (id == 0
- && sess->timeout >= (long)agesec
+ && sess->timeout >= (time_t)agesec
&& agems / (uint32_t)1000 == agesec
&& ticket_age <= agems + 1000
&& ticket_age + TICKET_AGE_ALLOWANCE >= agems + 1000) {