openssl: drop support for old OpenSSL/LibreSSL versions

Require OpenSSL 1.0.2a (2015-03-19) or LibreSSL 2.9.1 (2019-04-13).

Closes #16104
This commit is contained in:
Viktor Szakats 2025-01-27 20:35:23 +01:00
parent e0fd5790d9
commit 2cc90a679a
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
5 changed files with 68 additions and 278 deletions

View file

@ -32,41 +32,16 @@
#include "curl_sha256.h"
#include "curl_hmac.h"
#ifdef USE_WOLFSSL
#include <wolfssl/options.h>
#endif
#if defined(USE_OPENSSL)
#include <openssl/opensslv.h>
#if (OPENSSL_VERSION_NUMBER >= 0x0090800fL)
#define USE_OPENSSL_SHA256
#endif
#endif /* USE_OPENSSL */
#ifdef USE_MBEDTLS
#ifdef USE_OPENSSL
#include <openssl/evp.h>
#elif defined(USE_GNUTLS)
#include <nettle/sha.h>
#elif defined(USE_MBEDTLS)
#include <mbedtls/version.h>
#if(MBEDTLS_VERSION_NUMBER >= 0x02070000) && \
(MBEDTLS_VERSION_NUMBER < 0x03000000)
#define HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS
#endif
#endif /* USE_MBEDTLS */
#if defined(USE_OPENSSL_SHA256)
/* When OpenSSL or wolfSSL is available we use their SHA256-functions. */
#if defined(USE_OPENSSL)
#include <openssl/evp.h>
#elif defined(USE_WOLFSSL)
#include <wolfssl/openssl/evp.h>
#endif
#elif defined(USE_GNUTLS)
#include <nettle/sha.h>
#elif defined(USE_MBEDTLS)
#include <mbedtls/sha256.h>
#elif (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \
(__MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)) || \
@ -95,7 +70,7 @@
* file even if multiple backends are enabled at the same time.
*/
#if defined(USE_OPENSSL_SHA256)
#ifdef USE_OPENSSL
struct ossl_sha256_ctx {
EVP_MD_CTX *openssl_ctx;
@ -533,5 +508,4 @@ const struct HMAC_params Curl_HMAC_SHA256 = {
32 /* Result size. */
};
#endif /* AWS, DIGEST, or libssh2 */