Merge pull request #4959 from haydenroche5/asn1_time_diff_bug

Fix bug in wolfSSL_ASN1_TIME_diff.
This commit is contained in:
David Garske
2022-03-18 14:28:23 -07:00
committed by GitHub
2 changed files with 13 additions and 5 deletions

View File

@@ -32069,7 +32069,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;
}
@@ -32088,7 +32088,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;
}