From: Jeremy Harris Date: Tue, 12 Mar 2019 23:30:03 +0000 (+0000) Subject: Fix debug output of TLS keying info, client-side with OpenSSL X-Git-Tag: exim-4.93-RC0~261 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/1f93955ec73611886a4dc90bde07c3b91b666f53 Fix debug output of TLS keying info, client-side with OpenSSL --- diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index 306877f22..d37c78970 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -2723,12 +2723,17 @@ DEBUG(D_tls) #ifdef EXIM_HAVE_OPENSSL_KEYLOG { BIO * bp = BIO_new(BIO_s_mem()); - uschar * s; - int len; - SSL_SESSION_print_keylog(bp, SSL_get_session(server_ssl)); - len = (int) BIO_get_mem_data(bp, CSS &s); - debug_printf("%.*s", len, s); - BIO_free(bp); + if (bp) + { + uschar * s; + int len; + SSL_SESSION_print_keylog(bp, SSL_get_session(exim_client_ctx->ssl)); + len = (int) BIO_get_mem_data(bp, CSS &s); + debug_printf("%.*s", len, s); + BIO_free(bp); + } + else + debug_printf("(alloc failure for keylog)\n"); } #endif }