From 693985b73390267a92f2c1d5945f0c01699042f1 Mon Sep 17 00:00:00 2001 From: Martin Fleisz Date: Wed, 17 Aug 2022 14:06:45 +0200 Subject: [PATCH] crypto: Fix compilation with OpenSSL versions older than 1.1.1 --- libfreerdp/crypto/tls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index f9feb04fd..4e13acdcf 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -732,6 +732,7 @@ static BOOL tls_prepare(rdpTls* tls, BIO* underlying, SSL_METHOD* method, int op if (settings->TlsSecretsFile) { +#if OPENSSL_VERSION_NUMBER >= 0x10101000L InitOnceExecuteOnce(&secrets_file_idx_once, secrets_file_init_cb, NULL, NULL); if (secrets_file_idx != -1) @@ -739,6 +740,9 @@ static BOOL tls_prepare(rdpTls* tls, BIO* underlying, SSL_METHOD* method, int op SSL_set_ex_data(tls->ssl, secrets_file_idx, settings->TlsSecretsFile); SSL_CTX_set_keylog_callback(tls->ctx, SSLCTX_keylog_cb); } +#else + WLog_WARN(TAG, "Key-Logging not available - requires OpenSSL 1.1.1 or higher"); +#endif } BIO_push(tls->bio, underlying);