account for case where XTIME returns an unsigned type

This commit is contained in:
Jacob Barthelmeh
2021-10-26 15:50:11 -06:00
parent 9c665d7282
commit 583a50a3f6

View File

@ -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;
}