1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Use correct date in cert check error.

When a host certificate was used outside its valid date range, we were
displaying the current time where we meant to show the relevant bound of
the validity range.
This commit is contained in:
Jacob Nevins 2022-11-05 23:55:13 +00:00
parent f78a1a944f
commit 68db3d195d

View File

@ -1033,12 +1033,14 @@ static bool opensshcert_check_cert(
*/
if (time < ck->valid_after) {
put_fmt(error, "Certificate is not valid until ");
opensshcert_time_to_iso8601(BinarySink_UPCAST(error), time);
opensshcert_time_to_iso8601(BinarySink_UPCAST(error),
ck->valid_after);
goto out;
}
if (time >= ck->valid_before) {
put_fmt(error, "Certificate expired at ");
opensshcert_time_to_iso8601(BinarySink_UPCAST(error), time);
opensshcert_time_to_iso8601(BinarySink_UPCAST(error),
ck->valid_before);
goto out;
}