From d2e982efa727544b54628e37916c2497fe72cf21 Mon Sep 17 00:00:00 2001 From: Jacob Nevins Date: Tue, 30 Aug 2022 17:27:50 +0100 Subject: [PATCH] openssh-certs: Avoid C99 strftime() specifiers. These were introduced in 34d01e1b65 to pretty-print certificate validity ranges. But Microsoft's C runtime took a while to catch up with C99 -- stackoverflow claims that VS2013 and earlier don't support these specifiers -- so it's possible to end up with PuTTY executables that misdisplay these dates. Also, the mingw-w64 toolchain's -Wformat complains about these specifiers, at least on Debian buster, presumably for the same reason. Since the specifiers in question have exact pre-C99 replacements, it seems easiest just to use those. --- crypto/openssh-certs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/openssh-certs.c b/crypto/openssh-certs.c index 07f412b9..979b5488 100644 --- a/crypto/openssh-certs.c +++ b/crypto/openssh-certs.c @@ -581,7 +581,7 @@ static void opensshcert_time_to_iso8601(BinarySink *bs, uint64_t time) time_t t = time; char buf[256]; put_data(bs, buf, strftime(buf, sizeof(buf), - "%a %F %T %Z", localtime(&t))); + "%a %Y-%m-%d %H:%M:%S %Z", localtime(&t))); } static void opensshcert_string_list_key_components(