diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e0f868481..8aa44bbe88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,7 +298,6 @@ endif() option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON) mark_as_advanced(CMAKE_USE_OPENSSL) -set(USE_SSLEAY OFF) set(USE_OPENSSL OFF) set(HAVE_LIBCRYPTO OFF) set(HAVE_LIBSSL OFF) @@ -307,7 +306,6 @@ if(CMAKE_USE_OPENSSL) find_package(OpenSSL) if(OPENSSL_FOUND) list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES}) - set(USE_SSLEAY ON) set(USE_OPENSSL ON) set(HAVE_LIBCRYPTO ON) set(HAVE_LIBSSL ON) @@ -754,7 +752,6 @@ if(CMAKE_USE_OPENSSL) HAVE_CRYPTO_CLEANUP_ALL_EX_DATA) if(HAVE_LIBCRYPTO AND HAVE_LIBSSL) set(USE_OPENSSL 1) - set(USE_SSLEAY 1) endif(HAVE_LIBCRYPTO AND HAVE_LIBSSL) endif(CMAKE_USE_OPENSSL) check_symbol_exists(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R) diff --git a/configure.ac b/configure.ac index df1d372f79..48a82b47f6 100644 --- a/configure.ac +++ b/configure.ac @@ -1527,7 +1527,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then else - dnl Have the libraries--check for SSLeay/OpenSSL headers + dnl Have the libraries--check for OpenSSL headers AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \ openssl/pem.h openssl/ssl.h openssl/err.h, curl_ssl_msg="enabled (OpenSSL)" @@ -1551,17 +1551,11 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then fi if test X"$OPENSSL_ENABLED" = X"1"; then - AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled]) - dnl is there a pkcs12.h header present? AC_CHECK_HEADERS(openssl/pkcs12.h) else LIBS="$CLEANLIBS" fi - dnl USE_SSLEAY is the historical name for what configure calls - dnl OPENSSL_ENABLED; the names should really be unified - USE_SSLEAY="$OPENSSL_ENABLED" - AC_SUBST(USE_SSLEAY) if test X"$OPT_SSL" != Xoff && test "$OPENSSL_ENABLED" != "1"; then @@ -1675,8 +1669,8 @@ dnl --- if test "$OPENSSL_ENABLED" = "1"; then AC_CHECK_LIB(crypto, SRP_Calc_client_key, [ - AC_DEFINE(HAVE_SSLEAY_SRP, 1, [if you have the function SRP_Calc_client_key]) - AC_SUBST(HAVE_SSLEAY_SRP, [1]) + AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key]) + AC_SUBST(HAVE_OPENSSL_SRP, [1]) ]) fi @@ -3271,7 +3265,7 @@ AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]), want_tls_srp=yes ) -if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_SSLEAY_SRP" = "x1") ; then +if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication]) USE_TLS_SRP=1 curl_tls_srp_msg="enabled" @@ -3385,7 +3379,7 @@ dnl For keeping supported features and protocols also in pkg-config file dnl since it is more cross-compile friendly than curl-config dnl -if test "x$USE_SSLEAY" = "x1"; then +if test "x$USE_OPENSSL" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" elif test -n "$SSL_ENABLED"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" @@ -3424,7 +3418,7 @@ if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \ fi if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then - if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ + if test "x$USE_OPENSSL" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \ -o "x$DARWINSSL_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" @@ -3497,7 +3491,7 @@ if test "x$CURL_DISABLE_IMAP" != "x1"; then fi if test "x$CURL_DISABLE_SMB" != "x1" \ -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \ - -a \( "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ + -a \( "x$USE_OPENSSL" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \ -o "x$DARWINSSL_ENABLED" = "x1" \); then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB" diff --git a/lib/Makefile.b32 b/lib/Makefile.b32 index b9531fdf40..0565705758 100644 --- a/lib/Makefile.b32 +++ b/lib/Makefile.b32 @@ -74,7 +74,7 @@ LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib # SSL support is enabled setting WITH_SSL=1 !ifdef WITH_SSL -DEFINES = $(DEFINES) -DUSE_SSLEAY +DEFINES = $(DEFINES) -DUSE_OPENSSL INCDIRS = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl LINKLIB = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib !endif diff --git a/lib/Makefile.m32 b/lib/Makefile.m32 index 92bdb1f0db..7653e0d8a7 100644 --- a/lib/Makefile.m32 +++ b/lib/Makefile.m32 @@ -215,13 +215,13 @@ ifdef SSL endif endif INCLUDES += -I"$(OPENSSL_INCLUDE)" - CFLAGS += -DUSE_SSLEAY -DUSE_OPENSSL -DHAVE_OPENSSL_ENGINE_H -DHAVE_OPENSSL_PKCS12_H \ + CFLAGS += -DUSE_OPENSSL -DHAVE_OPENSSL_ENGINE_H -DHAVE_OPENSSL_PKCS12_H \ -DHAVE_ENGINE_LOAD_BUILTIN_ENGINES -DOPENSSL_NO_KRB5 \ -DCURL_WANTS_CA_BUNDLE_ENV DLL_LIBS += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS) ifdef SRP ifeq "$(wildcard $(OPENSSL_INCLUDE)/openssl/srp.h)" "$(OPENSSL_INCLUDE)/openssl/srp.h" - CFLAGS += -DHAVE_SSLEAY_SRP -DUSE_TLS_SRP + CFLAGS += -DHAVE_OPENSSL_SRP -DUSE_TLS_SRP endif endif endif diff --git a/lib/Makefile.vc6 b/lib/Makefile.vc6 index f97b73a7d2..04d4c67ceb 100644 --- a/lib/Makefile.vc6 +++ b/lib/Makefile.vc6 @@ -105,7 +105,7 @@ WINDOWS_SDK_PATH = "$(PROGRAMFILES)\Microsoft SDK" CCNODBG = cl.exe /O2 /DNDEBUG CCDEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /GZ -CFLAGSSSL = /DUSE_SSLEAY /DUSE_OPENSSL /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl" +CFLAGSSSL = /DUSE_OPENSSL /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl" CFLAGSWINSSL = /DUSE_SCHANNEL CFLAGSSSH2 = /DUSE_LIBSSH2 /DCURL_DISABLE_LDAP /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /I "$(LIBSSH2_PATH)/include" CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)" diff --git a/lib/config-amigaos.h b/lib/config-amigaos.h index 76d8877556..04b18b7446 100644 --- a/lib/config-amigaos.h +++ b/lib/config-amigaos.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -93,7 +93,6 @@ #define USE_MANUAL 1 #define USE_OPENSSL 1 -#define USE_SSLEAY 1 #define CURL_DISABLE_LDAP 1 #define OS "AmigaOS" diff --git a/lib/config-dos.h b/lib/config-dos.h index e094082b8c..288bd1db31 100644 --- a/lib/config-dos.h +++ b/lib/config-dos.h @@ -132,12 +132,11 @@ #define HAVE_LIBZ 1 #endif -/* USE_SSLEAY on cmd-line */ -#ifdef USE_SSLEAY +/* USE_OPENSSL on cmd-line */ +#ifdef USE_OPENSSL #define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1 #define HAVE_OPENSSL_ENGINE_H 1 #define OPENSSL_NO_KRB5 1 - #define USE_OPENSSL 1 #endif /* to disable LDAP */ diff --git a/lib/config-mac.h b/lib/config-mac.h index d89c38515a..ee7a6590c8 100644 --- a/lib/config-mac.h +++ b/lib/config-mac.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -70,7 +70,6 @@ #define HAVE_SIG_ATOMIC_T 1 #ifdef MACOS_SSL_SUPPORT -# define USE_SSLEAY 1 # define USE_OPENSSL 1 #endif diff --git a/lib/config-symbian.h b/lib/config-symbian.h index 5817628502..a40e3d8e08 100644 --- a/lib/config-symbian.h +++ b/lib/config-symbian.h @@ -808,10 +808,4 @@ #define HAVE_ZLIB_H 1 #endif -/* Enable appropriate definitions only when OpenSSL support is enabled */ -#ifdef USE_SSLEAY -/* if OpenSSL is in use */ -#define USE_OPENSSL -#endif - #endif /* HEADER_CURL_CONFIG_SYMBIAN_H */ diff --git a/lib/config-tpf.h b/lib/config-tpf.h index 6ff701a9f9..d6b8cc2f2d 100644 --- a/lib/config-tpf.h +++ b/lib/config-tpf.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -646,7 +646,7 @@ /* #undef USE_OPENSSL */ /* if SSL is enabled */ -/* #undef USE_SSLEAY */ +/* #undef USE_OPENSSL */ /* to enable SSPI support */ /* #undef USE_WINDOWS_SSPI */ diff --git a/lib/config-vxworks.h b/lib/config-vxworks.h index 515f7d48ca..d889efcd8c 100644 --- a/lib/config-vxworks.h +++ b/lib/config-vxworks.h @@ -883,9 +883,6 @@ /* if OpenSSL is in use */ #define USE_OPENSSL 1 -/* if SSL is enabled */ -#define USE_SSLEAY 1 - /* Define to 1 if you are building a Windows target without large file support. */ /* #undef USE_WIN32_LARGE_FILES */ diff --git a/lib/config-win32.h b/lib/config-win32.h index 8b543d5ca8..e9a371212f 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -701,7 +701,7 @@ Vista #endif /* Define to use the Windows crypto library. */ -#if !defined(USE_SSLEAY) && !defined(USE_NSS) +#if !defined(USE_OPENSSL) && !defined(USE_NSS) #define USE_WIN32_CRYPTO #endif diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake index 619e101caa..5376aa7e10 100644 --- a/lib/curl_config.h.cmake +++ b/lib/curl_config.h.cmake @@ -909,9 +909,6 @@ /* if OpenSSL is in use */ #cmakedefine USE_OPENSSL 1 -/* if SSL is enabled */ -#cmakedefine USE_SSLEAY 1 - /* if Unix domain sockets are enabled */ #cmakedefine USE_UNIX_SOCKETS diff --git a/lib/curl_des.c b/lib/curl_des.c index ba6249635a..42c1df9564 100644 --- a/lib/curl_des.c +++ b/lib/curl_des.c @@ -22,7 +22,7 @@ #include "curl_setup.h" -#if defined(USE_NTLM) && (!defined(USE_SSLEAY) || defined(HAVE_BORINGSSL)) +#if defined(USE_NTLM) && (!defined(USE_OPENSSL) || defined(HAVE_BORINGSSL)) #include "curl_des.h" @@ -60,4 +60,4 @@ void Curl_des_set_odd_parity(unsigned char *bytes, size_t len) } } -#endif /* USE_NTLM && (!USE_SSLEAY || HAVE_BORINGSSL) */ +#endif /* USE_NTLM && (!USE_OPENSSL || HAVE_BORINGSSL) */ diff --git a/lib/curl_des.h b/lib/curl_des.h index 11a2eca915..b855db4c17 100644 --- a/lib/curl_des.h +++ b/lib/curl_des.h @@ -24,11 +24,11 @@ #include "curl_setup.h" -#if defined(USE_NTLM) && (!defined(USE_SSLEAY) || defined(HAVE_BORINGSSL)) +#if defined(USE_NTLM) && (!defined(USE_OPENSSL) || defined(HAVE_BORINGSSL)) /* Applies odd parity to the given byte array */ void Curl_des_set_odd_parity(unsigned char *bytes, size_t length); -#endif /* USE_NTLM && (!USE_SSLEAY || HAVE_BORINGSSL) */ +#endif /* USE_NTLM && (!USE_OPENSSL || HAVE_BORINGSSL) */ #endif /* HEADER_CURL_DES_H */ diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index dc84fa8d0c..5b88fc5a0e 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -33,7 +33,7 @@ #if !defined(USE_WINDOWS_SSPI) || defined(USE_WIN32_CRYPTO) -#ifdef USE_SSLEAY +#ifdef USE_OPENSSL # ifdef USE_OPENSSL # include @@ -132,7 +132,7 @@ static void extend_key_56_to_64(const unsigned char *key_56, char *key) key[7] = (unsigned char) ((key_56[6] << 1) & 0xFF); } -#ifdef USE_SSLEAY +#ifdef USE_OPENSSL /* * Turns a 56 bit key into the 64 bit, odd parity key and sets the key. The * key schedule ks is also set. @@ -366,7 +366,7 @@ void Curl_ntlm_core_lm_resp(const unsigned char *keys, const unsigned char *plaintext, unsigned char *results) { -#ifdef USE_SSLEAY +#ifdef USE_OPENSSL DES_key_schedule ks; setup_des_key(keys, DESKEY(ks)); @@ -441,7 +441,7 @@ CURLcode Curl_ntlm_core_mk_lm_hash(struct SessionHandle *data, { /* Create LanManager hashed password. */ -#ifdef USE_SSLEAY +#ifdef USE_OPENSSL DES_key_schedule ks; setup_des_key(pw, DESKEY(ks)); @@ -532,7 +532,7 @@ CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data, { /* Create NT hashed password. */ -#ifdef USE_SSLEAY +#ifdef USE_OPENSSL MD4_CTX MD4pw; MD4_Init(&MD4pw); MD4_Update(&MD4pw, pw, 2 * len); diff --git a/lib/curl_ntlm_core.h b/lib/curl_ntlm_core.h index c1689666c8..3a763592ae 100644 --- a/lib/curl_ntlm_core.h +++ b/lib/curl_ntlm_core.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -28,7 +28,7 @@ #if !defined(USE_WINDOWS_SSPI) || defined(USE_WIN32_CRYPTO) -#ifdef USE_SSLEAY +#ifdef USE_OPENSSL # if !defined(OPENSSL_VERSION_NUMBER) && \ !defined(HEADER_SSL_H) && !defined(HEADER_MD5_H) # error "curl_ntlm_core.h shall not be included before OpenSSL headers." diff --git a/lib/curl_setup.h b/lib/curl_setup.h index c049ef9d26..9c7cc07ebe 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -604,7 +604,7 @@ int netware_init(void); #define LIBIDN_REQUIRED_VERSION "0.4.1" -#if defined(USE_GNUTLS) || defined(USE_SSLEAY) || defined(USE_NSS) || \ +#if defined(USE_GNUTLS) || defined(USE_OPENSSL) || defined(USE_NSS) || \ defined(USE_POLARSSL) || defined(USE_AXTLS) || \ defined(USE_CYASSL) || defined(USE_SCHANNEL) || \ defined(USE_DARWINSSL) || defined(USE_GSKIT) @@ -625,7 +625,7 @@ int netware_init(void); /* Single point where USE_NTLM definition might be defined */ #if !defined(CURL_DISABLE_NTLM) && !defined(CURL_DISABLE_CRYPTO_AUTH) -#if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI) || \ +#if defined(USE_OPENSSL) || defined(USE_WINDOWS_SSPI) || \ defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_DARWINSSL) || \ defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO) diff --git a/lib/getinfo.c b/lib/getinfo.c index 0ffdd74a03..8395ee9342 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -306,7 +306,7 @@ static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info, break; /* no SSL session found */ /* Return the TLS session information from the relevant backend */ -#ifdef USE_SSLEAY +#ifdef USE_OPENSSL internals = conn->ssl[sockindex].ctx; #endif #ifdef USE_GNUTLS diff --git a/lib/hostcheck.c b/lib/hostcheck.c index 21af8fa1c2..62a26e4f27 100644 --- a/lib/hostcheck.c +++ b/lib/hostcheck.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -22,7 +22,7 @@ #include "curl_setup.h" -#if defined(USE_SSLEAY) || defined(USE_AXTLS) || defined(USE_GSKIT) +#if defined(USE_OPENSSL) || defined(USE_AXTLS) || defined(USE_GSKIT) /* these backends use functions from this file */ #ifdef HAVE_NETINET_IN_H @@ -144,4 +144,4 @@ int Curl_cert_hostcheck(const char *match_pattern, const char *hostname) return res; } -#endif /* SSLEAY or AXTLS or GSKIT */ +#endif /* OPENSSL or AXTLS or GSKIT */ diff --git a/lib/http.c b/lib/http.c index 8f9b32ba76..e673a069b0 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1434,7 +1434,7 @@ static CURLcode https_connecting(struct connectdata *conn, bool *done) } #endif -#if defined(USE_SSLEAY) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ +#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ defined(USE_DARWINSSL) || defined(USE_POLARSSL) || defined(USE_NSS) /* This function is for OpenSSL, GnuTLS, darwinssl, schannel and polarssl only. It should be made to query the generic SSL layer instead. */ @@ -1473,7 +1473,7 @@ static int https_getsock(struct connectdata *conn, return GETSOCK_BLANK; } #endif /* USE_SSL */ -#endif /* USE_SSLEAY || USE_GNUTLS || USE_SCHANNEL */ +#endif /* USE_OPENSSL || USE_GNUTLS || USE_SCHANNEL */ /* * Curl_http_done() gets called from Curl_done() after a single HTTP request diff --git a/lib/md5.c b/lib/md5.c index 8ac1f6bc2f..7df66f524a 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -81,14 +81,9 @@ static void MD5_Final(unsigned char digest[16], MD5_CTX * ctx) gcry_md_close(*ctx); } -#elif defined(USE_SSLEAY) +#elif defined(USE_OPENSSL) /* When OpenSSL is available we use the MD5-function from OpenSSL */ - -# ifdef USE_OPENSSL -# include -# else -# include -# endif +#include #elif (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \ (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)) || \ diff --git a/lib/urldata.h b/lib/urldata.h index 50a745f112..29ceb9df36 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -82,38 +82,16 @@ #include "cookie.h" #include "formdata.h" -#ifdef USE_SSLEAY #ifdef USE_OPENSSL -#include -#include -#include -#include #include -#include #ifdef HAVE_OPENSSL_ENGINE_H #include #endif -#ifdef HAVE_OPENSSL_PKCS12_H -#include -#endif -#else /* SSLeay-style includes */ -#include -#include -#include -#include -#include -#include -#ifdef HAVE_OPENSSL_ENGINE_H -#include -#endif -#ifdef HAVE_OPENSSL_PKCS12_H -#include -#endif #endif /* USE_OPENSSL */ + #ifdef USE_GNUTLS #error Configuration error; cannot use GnuTLS *and* OpenSSL. #endif -#endif /* USE_SSLEAY */ #ifdef USE_GNUTLS #include @@ -291,13 +269,13 @@ struct ssl_connect_data { #ifdef USE_NGHTTP2 bool asked_for_h2; #endif -#ifdef USE_SSLEAY +#ifdef USE_OPENSSL /* these ones requires specific SSL-types */ SSL_CTX* ctx; SSL* handle; X509* server_cert; ssl_connect_state connecting_state; -#endif /* USE_SSLEAY */ +#endif /* USE_OPENSSL */ #ifdef USE_GNUTLS gnutls_session_t session; gnutls_certificate_credentials_t cred; @@ -1294,9 +1272,9 @@ struct UrlState { void *resolver; /* resolver state, if it is used in the URL state - ares_channel f.e. */ -#if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H) +#if defined(USE_OPENSSL) && defined(HAVE_OPENSSL_ENGINE_H) ENGINE *engine; -#endif /* USE_SSLEAY */ +#endif /* USE_OPENSSL */ struct timeval expiretime; /* set this with Curl_expire() only */ struct Curl_tree timenode; /* for the splay stuff */ struct curl_llist *timeoutlist; /* list of pending timeouts */ diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index b6e30144a0..731ecc508c 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -32,6 +32,8 @@ #include "curl_setup.h" +#ifdef USE_OPENSSL + #ifdef HAVE_LIMITS_H #include #endif @@ -51,9 +53,7 @@ #include "hostcheck.h" #include "curl_printf.h" -#ifdef USE_SSLEAY - -#ifdef USE_OPENSSL +#include #include #include #include @@ -62,14 +62,15 @@ #include #include #include +#include + +#ifdef HAVE_OPENSSL_PKCS12_H +#include +#endif + #ifndef HAVE_BORINGSSL #include #endif -#else -#include -#include -#include -#endif #include "warnless.h" #include "curl_memory.h" @@ -82,10 +83,6 @@ #error "OPENSSL_VERSION_NUMBER not defined" #endif -#if !defined(SSLEAY_VERSION_NUMBER) -#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER -#endif - #if OPENSSL_VERSION_NUMBER >= 0x0090581fL #define HAVE_SSL_GET1_SESSION 1 #else @@ -113,7 +110,7 @@ /* OpenSSL has PKCS 12 support, BoringSSL does not */ #define HAVE_PKCS12_SUPPORT #else -/* OpenSSL/SSLEay does not have PKCS12 support */ +/* OpenSSL does not have PKCS12 support */ #undef HAVE_PKCS12_SUPPORT #endif @@ -741,9 +738,6 @@ static char *SSL_strerror(unsigned long error, char *buf, size_t size) return buf; } -#endif /* USE_SSLEAY */ - -#ifdef USE_SSLEAY /** * Global SSL init * @@ -785,10 +779,6 @@ int Curl_ossl_init(void) return 1; } -#endif /* USE_SSLEAY */ - -#ifdef USE_SSLEAY - /* Global cleanup */ void Curl_ossl_cleanup(void) { @@ -843,7 +833,7 @@ int Curl_ossl_check_cxn(struct connectdata *conn) */ CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine) { -#if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H) +#if defined(USE_OPENSSL) && defined(HAVE_OPENSSL_ENGINE_H) ENGINE *e; #if OPENSSL_VERSION_NUMBER >= 0x00909000L @@ -911,7 +901,7 @@ CURLcode Curl_ossl_set_engine_default(struct SessionHandle *data) struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data) { struct curl_slist *list = NULL; -#if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H) +#if defined(USE_OPENSSL) && defined(HAVE_OPENSSL_ENGINE_H) struct curl_slist *beg; ENGINE *e; @@ -1447,7 +1437,7 @@ end: } #endif -#endif /* USE_SSLEAY */ +#endif /* USE_OPENSSL */ /* The SSL_CTRL_SET_MSG_CALLBACK doesn't exist in ancient OpenSSL versions and thus this cannot be done there. */ @@ -1592,7 +1582,7 @@ static void ssl_tls_trace(int direction, int ssl_ver, int content_type, } #endif -#ifdef USE_SSLEAY +#ifdef USE_OPENSSL /* ====================================================== */ #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME @@ -3109,7 +3099,7 @@ size_t Curl_ossl_version(char *buffer, size_t size) return snprintf(buffer, size, "BoringSSL"); #else /* OPENSSL_IS_BORINGSSL */ -#if(SSLEAY_VERSION_NUMBER >= 0x905000) +#if(OPENSSL_VERSION_NUMBER >= 0x905000) { char sub[3]; unsigned long ssleay_value; @@ -3148,31 +3138,31 @@ size_t Curl_ossl_version(char *buffer, size_t size) sub); } -#else /* SSLEAY_VERSION_NUMBER is less than 0.9.5 */ +#else /* OPENSSL_VERSION_NUMBER is less than 0.9.5 */ -#if(SSLEAY_VERSION_NUMBER >= 0x900000) +#if(OPENSSL_VERSION_NUMBER >= 0x900000) return snprintf(buffer, size, "OpenSSL/%lx.%lx.%lx", - (SSLEAY_VERSION_NUMBER>>28)&0xff, - (SSLEAY_VERSION_NUMBER>>20)&0xff, - (SSLEAY_VERSION_NUMBER>>12)&0xf); + (OPENSSL_VERSION_NUMBER>>28)&0xff, + (OPENSSL_VERSION_NUMBER>>20)&0xff, + (OPENSSL_VERSION_NUMBER>>12)&0xf); -#else /* (SSLEAY_VERSION_NUMBER >= 0x900000) */ +#else /* (OPENSSL_VERSION_NUMBER >= 0x900000) */ { char sub[2]; sub[1]='\0'; - if(SSLEAY_VERSION_NUMBER&0x0f) { - sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1; + if(OPENSSL_VERSION_NUMBER&0x0f) { + sub[0]=(OPENSSL_VERSION_NUMBER&0x0f) + 'a' -1; } else sub[0]='\0'; return snprintf(buffer, size, "SSL/%x.%x.%x%s", - (SSLEAY_VERSION_NUMBER>>12)&0xff, - (SSLEAY_VERSION_NUMBER>>8)&0xf, - (SSLEAY_VERSION_NUMBER>>4)&0xf, sub); + (OPENSSL_VERSION_NUMBER>>12)&0xff, + (OPENSSL_VERSION_NUMBER>>8)&0xf, + (OPENSSL_VERSION_NUMBER>>4)&0xf, sub); } -#endif /* (SSLEAY_VERSION_NUMBER >= 0x900000) */ -#endif /* SSLEAY_VERSION_NUMBER is less than 0.9.5 */ +#endif /* (OPENSSL_VERSION_NUMBER >= 0x900000) */ +#endif /* OPENSSL_VERSION_NUMBER is less than 0.9.5 */ #endif /* OPENSSL_IS_BORINGSSL */ #endif /* YASSL_VERSION */ @@ -3210,4 +3200,4 @@ bool Curl_ossl_cert_status_request(void) return FALSE; #endif } -#endif /* USE_SSLEAY */ +#endif /* USE_OPENSSL */ diff --git a/lib/vtls/openssl.h b/lib/vtls/openssl.h index 39103295c7..03c4738630 100644 --- a/lib/vtls/openssl.h +++ b/lib/vtls/openssl.h @@ -24,7 +24,7 @@ #include "curl_setup.h" -#ifdef USE_SSLEAY +#ifdef USE_OPENSSL /* * This header should only be needed to get included by vtls.c and openssl.c */ @@ -108,5 +108,5 @@ bool Curl_ossl_cert_status_request(void); #define DEFAULT_CIPHER_SELECTION "ALL!EXPORT!EXPORT40!EXPORT56!aNULL!LOW!RC4" -#endif /* USE_SSLEAY */ +#endif /* USE_OPENSSL */ #endif /* HEADER_CURL_SSLUSE_H */ diff --git a/packages/Symbian/group/libcurl.mmp b/packages/Symbian/group/libcurl.mmp index f016d37058..29ca54a587 100644 --- a/packages/Symbian/group/libcurl.mmp +++ b/packages/Symbian/group/libcurl.mmp @@ -16,7 +16,7 @@ MACRO BUILDING_LIBCURL MACRO HAVE_LIBZ #endif #ifdef ENABLE_SSL -MACRO USE_SSLEAY +MACRO USE_OPENSSL #endif SOURCEPATH ../../../lib diff --git a/packages/TPF/curl.mak b/packages/TPF/curl.mak index 6e93404649..5ef2ae16da 100644 --- a/packages/TPF/curl.mak +++ b/packages/TPF/curl.mak @@ -43,7 +43,6 @@ CFLAGS_CURL += -w # use SSL # (overrides Curl's lib/config-tpf.h file) CFLAGS_CURL += -DUSE_OPENSSL -CFLAGS_CURL += -DUSE_SSLEAY # disable all protocols except FTP and HTTP # (overrides Curl's lib/config-tpf.h file) diff --git a/packages/vms/build_vms.com b/packages/vms/build_vms.com index d7edc463e3..e21e57c477 100644 --- a/packages/vms/build_vms.com +++ b/packages/vms/build_vms.com @@ -549,7 +549,7 @@ $ if (.not. nossl) $ then $ if (f$trnlnm("OPENSSL") .nes. "") $ then -$! cc_defs = cc_defs + ", USE_SSLEAY=1" +$! cc_defs = cc_defs + ", USE_OPENSSL=1" $ if ((f$trnlnm("SSL$INCLUDE") .nes. "") .and. (.not. nohpssl)) $ then $! Use HP SSL. diff --git a/src/Makefile.Watcom b/src/Makefile.Watcom index c485665606..3945f96e56 100644 --- a/src/Makefile.Watcom +++ b/src/Makefile.Watcom @@ -75,7 +75,7 @@ CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6 !endif !ifdef %use_ssl -CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I"$(OPENSSL_ROOT)/inc32" +CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_OPENSSL -I"$(OPENSSL_ROOT)/inc32" !endif !ifdef %curl_static diff --git a/src/Makefile.b32 b/src/Makefile.b32 index 6638a01156..2505226198 100644 --- a/src/Makefile.b32 +++ b/src/Makefile.b32 @@ -67,7 +67,7 @@ LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib # SSL support is enabled setting WITH_SSL=1 !ifdef WITH_SSL -DEFINES = $(DEFINES) -DUSE_SSLEAY +DEFINES = $(DEFINES) -DUSE_OPENSSL INCDIRS = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl LINKLIB = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib !endif diff --git a/src/Makefile.m32 b/src/Makefile.m32 index f3f9054f95..3669833887 100644 --- a/src/Makefile.m32 +++ b/src/Makefile.m32 @@ -243,7 +243,7 @@ ifdef SSL OPENSSL_LIBS += -lgdi32 -lcrypt32 endif INCLUDES += -I"$(OPENSSL_INCLUDE)" - CFLAGS += -DUSE_SSLEAY -DUSE_OPENSSL + CFLAGS += -DUSE_OPENSSL curl_LDADD += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS) endif ifdef ZLIB diff --git a/src/Makefile.vc6 b/src/Makefile.vc6 index c8693afb94..415d528fbc 100644 --- a/src/Makefile.vc6 +++ b/src/Makefile.vc6 @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1999 - 2014, Daniel Stenberg, , et al. +# Copyright (C) 1999 - 2015, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -95,7 +95,7 @@ ZLIB_LFLAGS = "/LIBPATH:$(ZLIB_PATH)" ZLIB_LIBS = zlib.lib ZLIB_IMP_LIBS = zdll.lib -SSL_CFLAGS = /DUSE_SSLEAY +SSL_CFLAGS = /DUSE_OPENSSL SSL_LFLAGS = /LIBPATH:"$(OPENSSL_PATH)/out32" SSL_IMP_LFLAGS = /LIBPATH:"$(OPENSSL_PATH)/out32dll" SSL_LIBS = libeay32.lib ssleay32.lib gdi32.lib user32.lib diff --git a/src/tool_metalink.c b/src/tool_metalink.c index 3573b058b2..85d0ff4eb8 100644 --- a/src/tool_metalink.c +++ b/src/tool_metalink.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -29,14 +29,9 @@ # include #endif -#ifdef USE_SSLEAY -# ifdef USE_OPENSSL -# include -# include -# else -# include -# include -# endif +#ifdef USE_OPENSSL +# include +# include #elif defined(USE_GNUTLS_NETTLE) # include # include @@ -381,7 +376,7 @@ static void SHA256_Final(unsigned char digest[32], SHA256_CTX *ctx) sha256_finish(ctx, digest); } -#elif defined(_WIN32) && !defined(USE_SSLEAY) +#elif defined(_WIN32) && !defined(USE_OPENSSL) static void win32_crypto_final(struct win32_crypto_hash *ctx, unsigned char *digest, diff --git a/tests/unit/unit1397.c b/tests/unit/unit1397.c index fd60c2315c..c05c119db3 100644 --- a/tests/unit/unit1397.c +++ b/tests/unit/unit1397.c @@ -15,7 +15,7 @@ static void unit_stop( void ) UNITTEST_START /* only these backends define the tested functions */ -#if defined(USE_SSLEAY) || defined(USE_AXTLS) || defined(USE_GSKIT) +#if defined(USE_OPENSSL) || defined(USE_AXTLS) || defined(USE_GSKIT) /* here you start doing things and checking that the results are good */ diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc index 985c1bcc29..2cad15c9c4 100644 --- a/winbuild/MakefileBuild.vc +++ b/winbuild/MakefileBuild.vc @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1999 - 2014, Daniel Stenberg, , et al. +# Copyright (C) 1999 - 2015, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -118,7 +118,7 @@ SSL = static !ENDIF !IFDEF USE_SSL -SSL_CFLAGS = /DUSE_SSLEAY /I"$(DEVEL_INCLUDE)/openssl" +SSL_CFLAGS = /DUSE_OPENSSL /I"$(DEVEL_INCLUDE)/openssl" !ENDIF !IF "$(WITH_CARES)"=="dll"