]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ssl/ech/ech_internal.c: avoid truncating time_t value in ossl_ech_status_print
authorEugene Syromiatnikov <esyr@openssl.org>
Mon, 23 Feb 2026 04:22:03 +0000 (05:22 +0100)
committerTomas Mraz <tomas@openssl.org>
Wed, 25 Feb 2026 11:10:24 +0000 (12:10 +0100)
Avoid casting time_t (that is almost universally 64-bit nowadays)
to (32-bit) int and cast it to long long instead.

Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1681453
Fixes: ade10c5dbf20 "ECH client side"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Wed Feb 25 11:10:46 2026
(Merged from https://github.com/openssl/openssl/pull/30139)

ssl/ech/ech_internal.c

index 68dd1d1fb6f56ce3bd6c26197d45665a9e13f0f0..bda806f2d307ed68e63706e75de48be4eb8ee5b6 100644 (file)
@@ -804,8 +804,8 @@ void ossl_ech_status_print(BIO *out, SSL_CONNECTION *s, int selector)
                 OPENSSL_free(ec);
                 continue;
             }
-            BIO_printf(out, "ECH entry: %d public_name: %s age: %d%s\n",
-                i, pn, (int)secs, has_priv ? " (has private key)" : "");
+            BIO_printf(out, "ECH entry: %d public_name: %s age: %lld%s\n",
+                i, pn, (long long)secs, has_priv ? " (has private key)" : "");
             BIO_printf(out, "\t%s\n", ec);
             OPENSSL_free(pn);
             OPENSSL_free(ec);