From 583a50a3f6768baa5ee043ce4c0a23bbacfdc376 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 26 Oct 2021 15:50:11 -0600 Subject: [PATCH] account for case where XTIME returns an unsigned type --- src/ssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 00a0148fc..60971a356 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -27486,7 +27486,7 @@ int wolfSSL_ASN1_TIME_to_tm(const WOLFSSL_ASN1_TIME* asnTime, struct tm* tm) } currentTime = XTIME(0); - if (currentTime < 0) { + if (currentTime <= 0) { WOLFSSL_MSG("Failed to get current time."); return WOLFSSL_FAILURE; } @@ -30242,7 +30242,7 @@ int wolfSSL_ASN1_TIME_diff(int *days, int *secs, const WOLFSSL_ASN1_TIME *from, } fromSecs = XMKTIME(fromTm); - if (fromSecs < 0) { + if (fromSecs <= 0) { WOLFSSL_MSG("XMKTIME for from time failed."); return WOLFSSL_FAILURE; } @@ -30261,7 +30261,7 @@ int wolfSSL_ASN1_TIME_diff(int *days, int *secs, const WOLFSSL_ASN1_TIME *from, } toSecs = XMKTIME(toTm); - if (toSecs < 0) { + if (toSecs <= 0) { WOLFSSL_MSG("XMKTIME for to time failed."); return WOLFSSL_FAILURE; }