Skip to content

Commit

Permalink
Remove OpenSSL 1.0.2 support
Browse files Browse the repository at this point in the history
With Centos 7/Red Hat Enterprise Linux 7 being EOL this June, the last
distributions that still support OpenSSL 1.0.2 are finally EOL. This
means we no longer need to support OpenSSL 1.0.2

Change-Id: I90875311a4e4c403e77e30b609c1878cbaaaad45
Signed-off-by: Arne Schwabe <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg28665.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
schwabe authored and cron2 committed May 14, 2024
1 parent b3a271b commit 51f80db
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 693 deletions.
4 changes: 4 additions & 0 deletions Changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Default for ``--topology`` changed to ``subnet`` for ``--mode server``
``--topology net30`` to the config should fix the problem.
By default ``--topology`` is pushed from server to client.

OpenSSL 1.0.2 support
Support for building with OpenSSL 1.0.2 has been removed. The minimum
supported OpenSSL version is now 1.1.0.

Overview of changes in 2.6
==========================

Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ SYSTEM REQUIREMENTS:
(1) TUN and/or TAP driver to allow user-space programs to control
a virtual point-to-point IP or Ethernet device.
See TUN/TAP Driver References section below for more info.
(2a) OpenSSL library, necessary for encryption, version 1.0.2 or higher
(2a) OpenSSL library, necessary for encryption, version 1.1.0 or higher
required, available from http://www.openssl.org/
or
(2b) mbed TLS library, an alternative for encryption, version 2.0 or higher
Expand Down
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ if test "${with_crypto_library}" = "openssl"; then
# if the user did not explicitly specify flags, try to autodetect
PKG_CHECK_MODULES(
[OPENSSL],
[openssl >= 1.0.2],
[openssl >= 1.1.0],
[have_openssl="yes"],
[AC_MSG_WARN([OpenSSL not found by pkg-config ${pkg_config_found}])] # If this fails, we will do another test next
)
Expand All @@ -903,15 +903,15 @@ if test "${with_crypto_library}" = "openssl"; then
# If pkgconfig check failed or OPENSSL_CFLAGS/OPENSSL_LIBS env vars
# are used, check the version directly in the OpenSSL include file
if test "${have_openssl}" != "yes"; then
AC_MSG_CHECKING([additionally if OpenSSL is available and version >= 1.0.2])
AC_MSG_CHECKING([additionally if OpenSSL is available and version >= 1.1.0])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <openssl/opensslv.h>
]],
[[
/* Version encoding: MNNFFPPS - see opensslv.h for details */
#if OPENSSL_VERSION_NUMBER < 0x10002000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#error OpenSSL too old
#endif
]]
Expand Down Expand Up @@ -981,7 +981,7 @@ if test "${with_crypto_library}" = "openssl"; then
[AC_MSG_ERROR([OpenSSL check for AES-256-GCM support failed])]
)

# All supported OpenSSL version (>= 1.0.2)
# All supported OpenSSL version (>= 1.1.0)
# have this feature
have_export_keying_material="yes"

Expand Down
12 changes: 4 additions & 8 deletions src/openvpn/crypto_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <openssl/rand.h>
#include <openssl/ssl.h>

#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
#if !defined(LIBRESSL_VERSION_NUMBER)
#include <openssl/kdf.h>
#endif
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
Expand Down Expand Up @@ -193,11 +193,7 @@ crypto_unload_provider(const char *provname, provider_t *provider)
void
crypto_init_lib(void)
{
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
#else
OPENSSL_config(NULL);
#endif
/*
* If you build the OpenSSL library and OpenVPN with
* CRYPTO_MDEBUG, you will get a listing of OpenSSL
Expand Down Expand Up @@ -1401,7 +1397,7 @@ ssl_tls1_PRF(const uint8_t *seed, int seed_len, const uint8_t *secret,

return ret;
}
#elif (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
#elif !defined(LIBRESSL_VERSION_NUMBER)
bool
ssl_tls1_PRF(const uint8_t *seed, int seed_len, const uint8_t *secret,
int secret_len, uint8_t *output, int output_len)
Expand Down Expand Up @@ -1447,7 +1443,7 @@ ssl_tls1_PRF(const uint8_t *seed, int seed_len, const uint8_t *secret,
EVP_PKEY_CTX_free(pctx);
return ret;
}
#else /* if OPENSSL_VERSION_NUMBER >= 0x10100000L */
#else /* if defined(LIBRESSL_VERSION_NUMBER) */
/*
* Generate the hash required by for the \c tls1_PRF function.
*
Expand Down Expand Up @@ -1626,5 +1622,5 @@ ssl_tls1_PRF(const uint8_t *label, int label_len, const uint8_t *sec,
gc_free(&gc);
return ret;
}
#endif /* if OPENSSL_VERSION_NUMBER >= 0x10100000L */
#endif /* if LIBRESSL_VERSION_NUMBER */
#endif /* ENABLE_CRYPTO_OPENSSL */
Loading

0 comments on commit 51f80db

Please sign in to comment.