Commit 054027e1ba for openssl.org
commit 054027e1ba3ef0fe359d432df4662ded147f908a
Author: Eugene Syromiatnikov <esyr@openssl.org>
Date: Mon Feb 23 05:22:03 2026 +0100
ssl/ech/ech_internal.c: avoid truncating time_t value in ossl_ech_status_print
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)
diff --git a/ssl/ech/ech_internal.c b/ssl/ech/ech_internal.c
index 68dd1d1fb6..bda806f2d3 100644
--- a/ssl/ech/ech_internal.c
+++ b/ssl/ech/ech_internal.c
@@ -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);