Skip to content

Commit

Permalink
tcp: avoid deprecated ENGINE_cleanup
Browse files Browse the repository at this point in the history
ENGINE_cleanup is deprecated as of OpenSSL 1.1.0, and may not be available
with 3.0 and OPENSSL_NO_ENGINE.

Signed-off-by: Yaakov Selkowitz <[email protected]>
  • Loading branch information
yselkowitz committed Sep 8, 2024
1 parent 27d9a8c commit 42345d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
# if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
# include <openssl/bioerr.h>
# endif
# include <openssl/engine.h>
/* OpenSSL API differences */
# if OPENSSL_VERSION_NUMBER >= 0x10100000L
# define RSYSLOG_X509_NAME_oneline(X509CERT) X509_get_subject_name(X509CERT)
# define RSYSLOG_BIO_method_name(SSLBIO) BIO_method_name(SSLBIO)
# define RSYSLOG_BIO_number_read(SSLBIO) BIO_number_read(SSLBIO)
# define RSYSLOG_BIO_number_written(SSLBIO) BIO_number_written(SSLBIO)
# else
# include <openssl/engine.h>
# define RSYSLOG_X509_NAME_oneline(X509CERT) (X509CERT != NULL ? X509CERT->cert_info->subject : NULL)
# define RSYSLOG_BIO_method_name(SSLBIO) SSLBIO->method->name
# define RSYSLOG_BIO_number_read(SSLBIO) SSLBIO->num
Expand Down Expand Up @@ -1989,7 +1989,9 @@ relpTcpExitTLS_ossl(void)
SSL_CTX_free(ctx);
ctx = NULL;
}
#if OPENSSL_VERSION_NUMBER < 0x10100000L
ENGINE_cleanup();
#endif
ERR_free_strings();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
Expand Down

0 comments on commit 42345d9

Please sign in to comment.