Skip to content

Commit

Permalink
Guard the inclusion of the OpenSSL ENGINE header file, as newer OpenS…
Browse files Browse the repository at this point in the history
…SL versions have deprecated that ENGINE mechanism entirely, in favor of other approaches.

This is the mod_proxy equivalent of proftpd/proftpd@43184c0
  • Loading branch information
Castaglia committed Jul 12, 2024
1 parent c17e416 commit 1c6d854
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions include/proxy/tls.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ProFTPD - mod_proxy TLS API
* Copyright (c) 2015-2021 TJ Saunders
* Copyright (c) 2015-2024 TJ Saunders
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -39,7 +39,9 @@
# include <openssl/x509v3.h>
# include <openssl/rand.h>
# if OPENSSL_VERSION_NUMBER > 0x000907000L
# include <openssl/engine.h>
# if defined(PR_USE_OPENSSL_ENGINE)
# include <openssl/engine.h>
# endif /* PR_USE_OPENSSL_ENGINE */
# include <openssl/ocsp.h>
# endif
# ifdef PR_USE_OPENSSL_ECC
Expand Down
12 changes: 7 additions & 5 deletions lib/proxy/ssh/crypto.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ProFTPD - mod_proxy SSH crypto
* Copyright (c) 2021-2022 TJ Saunders
* Copyright (c) 2021-2024 TJ Saunders
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -37,8 +37,9 @@
#include <openssl/err.h>

#if OPENSSL_VERSION_NUMBER > 0x000907000L && \
OPENSSL_VERSION_NUMBER < 0x10100000L
#include <openssl/engine.h>
OPENSSL_VERSION_NUMBER < 0x10100000L && \
defined(PR_USE_OPENSSL_ENGINE)
# include <openssl/engine.h>
static const char *crypto_engine = NULL;
#endif

Expand Down Expand Up @@ -1407,8 +1408,9 @@ void proxy_ssh_crypto_free(int flags) {
pr_module_get("mod_tls.c") == NULL) {

#if OPENSSL_VERSION_NUMBER > 0x000907000L && \
OPENSSL_VERSION_NUMBER < 0x10100000L
if (crypto_engine) {
OPENSSL_VERSION_NUMBER < 0x10100000L && \
defined(PR_USE_OPENSSL_ENGINE)
if (crypto_engine != NULL) {
ENGINE_cleanup();
crypto_engine = NULL;
}
Expand Down

0 comments on commit 1c6d854

Please sign in to comment.