]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
egd: delete feature detection and related source code
authorViktor Szakats <commit@vsz.me>
Mon, 31 Jul 2023 11:52:44 +0000 (11:52 +0000)
committerViktor Szakats <commit@vsz.me>
Tue, 1 Aug 2023 21:58:56 +0000 (21:58 +0000)
EGD is Entropy Gathering Daemon, a socket-based entropy source supported
by pre-OpenSSL v1.1 versions and now deprecated. curl also deprecated it
a while ago.

Its detection in CMake was broken all along because OpenSSL libs were
not linked at the point of feature check.

Delete detection from both cmake and autotools, along with the related
source snippet, and the `--with-egd-socket=` `./configure` option.

Closes #11556

12 files changed:
CMake/Platforms/WindowsCache.cmake
CMakeLists.txt
lib/config-amigaos.h
lib/config-mac.h
lib/config-os400.h
lib/config-riscos.h
lib/curl_config.h.cmake
lib/setup-vms.h
lib/vtls/openssl.c
m4/curl-openssl.m4
packages/vms/gnv_conftest.c_first
scripts/ciconfig.pl

index 37712377e4cfdd185c42147bf324bec3d931b329..c69c33cc36e17e43d7d11a1439d4e4b84fa2bfb5 100644 (file)
@@ -66,7 +66,6 @@ if(NOT UNIX)
     set(HAVE_GETPWUID 0)
     set(HAVE_GETEUID 0)
     set(HAVE_UTIME 1)
-    set(HAVE_RAND_EGD 0)
     set(HAVE_GMTIME_R 0)
     set(HAVE_GETHOSTBYNAME_R 0)
     set(HAVE_SIGNAL 1)
index f301a225537e8fa2ce234ad9987bae15052b556e..e19deb605eae801958e482fd7812bda11d1959fe 100644 (file)
@@ -50,7 +50,6 @@
 #
 # The following variables are available:
 #   HAVE_SSL_SET0_WBIO: `SSL_set0_wbio` present in OpenSSL
-#   HAVE_RAND_EGD: `RAND_egd` present in OpenSSL
 #   HAVE_AWSLC: OpenSSL is AWS-LC
 #   HAVE_BORINGSSL: OpenSSL is BoringSSL
 #   HAVE_SSL_CTX_SET_QUIC_METHOD: `SSL_CTX_set_quic_method` present in OpenSSL/wolfSSL
@@ -598,9 +597,6 @@ if(USE_OPENSSL OR USE_WOLFSSL)
   if(NOT DEFINED HAVE_SSL_SET0_WBIO)
     openssl_check_symbol_exists(SSL_set0_wbio "openssl/ssl.h" HAVE_SSL_SET0_WBIO)
   endif()
-  if(NOT DEFINED HAVE_RAND_EGD)
-    openssl_check_symbol_exists(RAND_egd "${CURL_INCLUDES}" HAVE_RAND_EGD)
-  endif()
 endif()
 
 option(USE_NGHTTP2 "Use Nghttp2 library" OFF)
index 11f36a121af4f67e48f86f8430f3391cffe20e28..a6a518abb325e6e7252ec73f6c88e4a88512fcff 100644 (file)
@@ -40,7 +40,6 @@
 #define HAVE_NETINET_IN_H 1
 #define HAVE_NET_IF_H 1
 #define HAVE_PWD_H 1
-#define HAVE_RAND_EGD 1
 #define HAVE_SELECT 1
 #define HAVE_SETJMP_H 1
 #define HAVE_SIGNAL 1
index 8bd2fbd09c53f491f34aa5562984e7f2b2ec9c41..ff6fdb25ae7a1c7632eb1aea9dae77f635875f4b 100644 (file)
@@ -77,8 +77,6 @@
 
 #define CURL_DISABLE_LDAP       1
 
-#define HAVE_RAND_EGD           1
-
 #define HAVE_IOCTL_FIONBIO      1
 
 #define SIZEOF_INT              4
index 8d48955eefcca6a17c31ea07228941b66ad1d788..db8e9082e28771c3cd7a658d1c8849bf181b822f 100644 (file)
@@ -68,9 +68,6 @@
 /* Define this as a suitable file to read random data from */
 #undef RANDOM_FILE
 
-/* Define this to your Entropy Gathering Daemon socket pathname */
-#undef EGD_SOCKET
-
 /* Define to 1 if you have the alarm function. */
 #define HAVE_ALARM 1
 
 /* Define if you have the <pwd.h> header file. */
 #define HAVE_PWD_H
 
-/* Define if you have the `RAND_egd' function. */
-#undef HAVE_RAND_EGD
-
 /* Define if you have the `select' function. */
 #define HAVE_SELECT
 
index 246473194ef81e02b77d4f27c564ad3d88e83b17..a9268e1e90cdbac8f493d0bea59a18be323561e3 100644 (file)
@@ -66,9 +66,6 @@
 /* Define this as a suitable file to read random data from */
 #undef RANDOM_FILE
 
-/* Define this to your Entropy Gathering Daemon socket pathname */
-#undef EGD_SOCKET
-
 /* Define if you want to enable IPv6 support */
 #undef ENABLE_IPV6
 
 /* Define if you have the <pwd.h> header file. */
 #undef HAVE_PWD_H
 
-/* Define if you have the `RAND_egd' function. */
-#undef HAVE_RAND_EGD
-
 /* Define if you have the `select' function. */
 #define HAVE_SELECT
 
index 30bb0e458f6b9ef760791ae5b422cff8a25077ae..cdc59333cdd7232c78ad9d219c188080d51b2ef8 100644 (file)
 /* Use Windows LDAP implementation */
 #cmakedefine USE_WIN32_LDAP 1
 
-/* your Entropy Gathering Daemon socket pathname */
-#cmakedefine EGD_SOCKET ${EGD_SOCKET}
-
 /* Define if you want to enable IPv6 support */
 #cmakedefine ENABLE_IPV6 1
 
 /* Define to 1 if OpenSSL has the `SSL_set0_wbio` function. */
 #cmakedefine HAVE_SSL_SET0_WBIO 1
 
-/* Define to 1 if you have the `RAND_egd' function. */
-#cmakedefine HAVE_RAND_EGD 1
-
 /* Define to 1 if you have the recv function. */
 #cmakedefine HAVE_RECV 1
 
index 46657b2cd4b120839f28be4ce034d4365530af7b..645cc1a9cda7fb80347e80a7b158ca2e4400a274 100644 (file)
@@ -262,7 +262,6 @@ static struct passwd *vms_getpwuid(uid_t uid)
 #define PKCS12_parse PKCS12_PARSE
 #define RAND_add RAND_ADD
 #define RAND_bytes RAND_BYTES
-#define RAND_egd RAND_EGD
 #define RAND_file_name RAND_FILE_NAME
 #define RAND_load_file RAND_LOAD_FILE
 #define RAND_status RAND_STATUS
index 51f7b26f851a5d844c3574b9375f0cfc06ef2977..fa8938abc457f2c464ee1ebf09a6355251f89e0c 100644 (file)
@@ -996,20 +996,6 @@ static CURLcode ossl_seed(struct Curl_easy *data)
     return CURLE_OK;
 #endif
 
-#if defined(HAVE_RAND_EGD) && defined(EGD_SOCKET)
-  /* available in OpenSSL 0.9.5 and later */
-  /* EGD_SOCKET is set at configure time or not at all */
-  {
-    /* If there's an option and a define, the option overrides the
-       define */
-    int ret = RAND_egd(EGD_SOCKET);
-    if(-1 != ret) {
-      if(rand_enough())
-        return CURLE_OK;
-    }
-  }
-#endif
-
   /* fallback to a custom seeding of the PRNG using a hash based on a current
      time */
   do {
index b3a63225a74c0b88435ff308c5f093dd87c26538..3cbbb5e8ddd69b31a49690ad18eafef81f2b6de8 100644 (file)
@@ -259,8 +259,6 @@ if test "x$OPT_OPENSSL" != xno; then
   if test X"$OPENSSL_ENABLED" = X"1"; then
     dnl These can only exist if OpenSSL exists
 
-    AC_CHECK_FUNCS( RAND_egd )
-
     AC_MSG_CHECKING([for BoringSSL])
     AC_COMPILE_IFELSE([
         AC_LANG_PROGRAM([[
@@ -363,16 +361,6 @@ dnl Check for the random seed preferences
 dnl **********************************************************************
 
 if test X"$OPENSSL_ENABLED" = X"1"; then
-  AC_ARG_WITH(egd-socket,
-  AS_HELP_STRING([--with-egd-socket=FILE],
-                 [Entropy Gathering Daemon socket pathname]),
-      [ EGD_SOCKET="$withval" ]
-  )
-  if test -n "$EGD_SOCKET" ; then
-          AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
-          [your Entropy Gathering Daemon socket pathname] )
-  fi
-
   dnl Check for user-specified random device
   AC_ARG_WITH(random,
   AS_HELP_STRING([--with-random=FILE],
index 5b566086168ad1364b3eeff408fc25c8cff21519..317b1abfc75ad9051fa71138a7ccfe44100c6f22 100644 (file)
@@ -33,7 +33,6 @@ char SSL_connect(void) {return 0;}
 char ENGINE_init(void) {return 0;}
 char RAND_status(void) {return 0;}
 /* char RAND_screen(void) {return 0;} In headers, but not present */
-char RAND_egd(void) {return 0;}
 char CRYPTO_cleanup_all_ex_data(void) {return 0;}
 char SSL_get_shutdown(void) {return 0;}
 char ENGINE_load_builtin_engines (void) {return 0;}
@@ -46,7 +45,6 @@ char ENGINE_load_builtin_engines (void) {return 0;}
 #define ENGINE_init ENGINE_INIT
 #define RAND_status RAND_STATUS
 /* #define RAND_screen RAND_SCREEN */
-#define RAND_egd RAND_EGD
 #define CRYPTO_cleanup_all_ex_data CRYPTO_CLEANUP_ALL_EX_DATA
 #define SSL_get_shutdown SSL_GET_SHUTDOWN
 #define ENGINE_load_builtin_engines ENGINE_LOAD_BUILTIN_ENGINES
index a3ac4f6c9c19ea0e21d1e4ab7d33d6b4bee742fb..7c31f8e4a0a966955b8e26451d2d9db2e533f375 100755 (executable)
@@ -83,7 +83,6 @@ my %defaulton = (
     'zstd' => 1,
     'brotli' => 1,
     'random' => 1,
-    'egd-socket' => 1,
     'ca-bundle' => 1,
     'ca-path' => 1,
     'libssh2' => 1,