1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-11 08:08:06 -05: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.

(cherry picked from commit 68db3d195d00e3f3904a7e004a4efd00fd303efb)
This commit is contained in:
Jacob Nevins 2022-11-05 23:55:13 +00:00 committed by Simon Tatham
parent 4d888d1ff4
commit b760a2a040

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