print SSL session, fix build warnings on OpenBSD.
authorDavid Carlier <devnexen@gmail.com>
Wed, 16 Mar 2022 23:21:58 +0000 (23:21 +0000)
committerTomas Mraz <tomas@openssl.org>
Fri, 18 Mar 2022 11:49:09 +0000 (12:49 +0100)
time_t is a 64 bits type on this platform.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17917)

ssl/ssl_txt.c

index 6abee5da41cb1774b379b09ad7b7068268f0d3e6..bd925539554e7b73b904e2365aa7b8dae30c699f 100644 (file)
@@ -129,11 +129,11 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
     }
 #endif
     if (x->time != 0L) {
-        if (BIO_printf(bp, "\n    Start Time: %ld", x->time) <= 0)
+        if (BIO_printf(bp, "\n    Start Time: %lld", (long long)x->time) <= 0)
             goto err;
     }
     if (x->timeout != 0L) {
-        if (BIO_printf(bp, "\n    Timeout   : %ld (sec)", x->timeout) <= 0)
+        if (BIO_printf(bp, "\n    Timeout   : %lld (sec)", (long long)x->timeout) <= 0)
             goto err;
     }
     if (BIO_puts(bp, "\n") <= 0)