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.

(cherry picked from commit 68db3d195d)
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) { if (time < ck->valid_after) {
put_fmt(error, "Certificate is not valid until "); 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; goto out;
} }
if (time >= ck->valid_before) { if (time >= ck->valid_before) {
put_fmt(error, "Certificate expired at "); 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; goto out;
} }