Skip to content

Commit d139826

Browse files
committed
when building against OpenSSL, require at least version 1.1.1
1 parent 1ca1ba0 commit d139826

File tree

3 files changed

+3
-26
lines changed

3 files changed

+3
-26
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
2.0.12
22

3+
* when building against OpenSSL, require at least version 1.1.1
34
* add setting to set no-copy-on-write flag on new files
45
* add performance counters to file pool
56
* add high_priority flag to torrent_handle::force_reannounce()

include/libtorrent/ssl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ POSSIBILITY OF SUCH DAMAGE.
5454

5555
#ifdef TORRENT_USE_OPENSSL
5656
#include <openssl/opensslv.h> // for OPENSSL_VERSION_NUMBER
57-
#if OPENSSL_VERSION_NUMBER < 0x1000000fL
58-
#error OpenSSL too old, use a recent version with SNI support
57+
#if OPENSSL_VERSION_NUMBER < 0x1010100fL
58+
#error OpenSSL too old, libtorrent requires least OpenSSL 1.1.1 or later
5959
#endif
6060
#ifdef TORRENT_WINDOWS
6161
// because openssl includes winsock.h, we must include winsock2.h first

src/ssl.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -178,31 +178,7 @@ namespace {
178178
{
179179
lifecycle()
180180
{
181-
// this is needed for openssl < 1.0 to decrypt keys created by openssl 1.0+
182-
#if !defined(OPENSSL_API_COMPAT) || (OPENSSL_API_COMPAT < 0x10100000L)
183-
OpenSSL_add_all_algorithms();
184-
#else
185181
OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS | OPENSSL_INIT_ADD_ALL_DIGESTS, nullptr);
186-
#endif
187-
}
188-
189-
~lifecycle()
190-
{
191-
// by openssl changelog at https://www.openssl.org/news/changelog.html
192-
// Changes between 1.0.2h and 1.1.0 [25 Aug 2016]
193-
// - Most global cleanup functions are no longer required because they are handled
194-
// via auto-deinit. Affected function CRYPTO_cleanup_all_ex_data()
195-
#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L
196-
#ifdef TORRENT_MACOS_DEPRECATED_LIBCRYPTO
197-
#pragma clang diagnostic push
198-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
199-
#endif
200-
// openssl requires this to clean up internal structures it allocates
201-
CRYPTO_cleanup_all_ex_data();
202-
#ifdef TORRENT_MACOS_DEPRECATED_LIBCRYPTO
203-
#pragma clang diagnostic pop
204-
#endif
205-
#endif
206182
}
207183
} global;
208184
}

0 commit comments

Comments
 (0)