Skip to content

Commit 83c53bc

Browse files
vszakatsptitSeb
authored andcommitted
egd: delete feature detection and related source code
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 curl#11556
1 parent 3548811 commit 83c53bc

12 files changed

+0
-56
lines changed

CMake/Platforms/WindowsCache.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ if(NOT UNIX)
6666
set(HAVE_GETPWUID 0)
6767
set(HAVE_GETEUID 0)
6868
set(HAVE_UTIME 1)
69-
set(HAVE_RAND_EGD 0)
7069
set(HAVE_GMTIME_R 0)
7170
set(HAVE_GETHOSTBYNAME_R 0)
7271
set(HAVE_SIGNAL 1)

CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#
5151
# The following variables are available:
5252
# HAVE_SSL_SET0_WBIO: `SSL_set0_wbio` present in OpenSSL
53-
# HAVE_RAND_EGD: `RAND_egd` present in OpenSSL
5453
# HAVE_AWSLC: OpenSSL is AWS-LC
5554
# HAVE_BORINGSSL: OpenSSL is BoringSSL
5655
# 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)
598597
if(NOT DEFINED HAVE_SSL_SET0_WBIO)
599598
openssl_check_symbol_exists(SSL_set0_wbio "openssl/ssl.h" HAVE_SSL_SET0_WBIO)
600599
endif()
601-
if(NOT DEFINED HAVE_RAND_EGD)
602-
openssl_check_symbol_exists(RAND_egd "${CURL_INCLUDES}" HAVE_RAND_EGD)
603-
endif()
604600
endif()
605601

606602
option(USE_NGHTTP2 "Use Nghttp2 library" OFF)

lib/config-amigaos.h

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#define HAVE_NETINET_IN_H 1
4141
#define HAVE_NET_IF_H 1
4242
#define HAVE_PWD_H 1
43-
#define HAVE_RAND_EGD 1
4443
#define HAVE_SELECT 1
4544
#define HAVE_SETJMP_H 1
4645
#define HAVE_SIGNAL 1

lib/config-mac.h

-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@
7777

7878
#define CURL_DISABLE_LDAP 1
7979

80-
#define HAVE_RAND_EGD 1
81-
8280
#define HAVE_IOCTL_FIONBIO 1
8381

8482
#define SIZEOF_INT 4

lib/config-os400.h

-6
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@
6868
/* Define this as a suitable file to read random data from */
6969
#undef RANDOM_FILE
7070

71-
/* Define this to your Entropy Gathering Daemon socket pathname */
72-
#undef EGD_SOCKET
73-
7471
/* Define to 1 if you have the alarm function. */
7572
#define HAVE_ALARM 1
7673

@@ -143,9 +140,6 @@
143140
/* Define if you have the <pwd.h> header file. */
144141
#define HAVE_PWD_H
145142

146-
/* Define if you have the `RAND_egd' function. */
147-
#undef HAVE_RAND_EGD
148-
149143
/* Define if you have the `select' function. */
150144
#define HAVE_SELECT
151145

lib/config-riscos.h

-6
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@
6666
/* Define this as a suitable file to read random data from */
6767
#undef RANDOM_FILE
6868

69-
/* Define this to your Entropy Gathering Daemon socket pathname */
70-
#undef EGD_SOCKET
71-
7269
/* Define if you want to enable IPv6 support */
7370
#undef ENABLE_IPV6
7471

@@ -135,9 +132,6 @@
135132
/* Define if you have the <pwd.h> header file. */
136133
#undef HAVE_PWD_H
137134

138-
/* Define if you have the `RAND_egd' function. */
139-
#undef HAVE_RAND_EGD
140-
141135
/* Define if you have the `select' function. */
142136
#define HAVE_SELECT
143137

lib/curl_config.h.cmake

-6
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@
135135
/* Use Windows LDAP implementation */
136136
#cmakedefine USE_WIN32_LDAP 1
137137

138-
/* your Entropy Gathering Daemon socket pathname */
139-
#cmakedefine EGD_SOCKET ${EGD_SOCKET}
140-
141138
/* Define if you want to enable IPv6 support */
142139
#cmakedefine ENABLE_IPV6 1
143140

@@ -400,9 +397,6 @@
400397
/* Define to 1 if OpenSSL has the `SSL_set0_wbio` function. */
401398
#cmakedefine HAVE_SSL_SET0_WBIO 1
402399

403-
/* Define to 1 if you have the `RAND_egd' function. */
404-
#cmakedefine HAVE_RAND_EGD 1
405-
406400
/* Define to 1 if you have the recv function. */
407401
#cmakedefine HAVE_RECV 1
408402

lib/setup-vms.h

-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ static struct passwd *vms_getpwuid(uid_t uid)
262262
#define PKCS12_parse PKCS12_PARSE
263263
#define RAND_add RAND_ADD
264264
#define RAND_bytes RAND_BYTES
265-
#define RAND_egd RAND_EGD
266265
#define RAND_file_name RAND_FILE_NAME
267266
#define RAND_load_file RAND_LOAD_FILE
268267
#define RAND_status RAND_STATUS

lib/vtls/openssl.c

-14
Original file line numberDiff line numberDiff line change
@@ -996,20 +996,6 @@ static CURLcode ossl_seed(struct Curl_easy *data)
996996
return CURLE_OK;
997997
#endif
998998

999-
#if defined(HAVE_RAND_EGD) && defined(EGD_SOCKET)
1000-
/* available in OpenSSL 0.9.5 and later */
1001-
/* EGD_SOCKET is set at configure time or not at all */
1002-
{
1003-
/* If there's an option and a define, the option overrides the
1004-
define */
1005-
int ret = RAND_egd(EGD_SOCKET);
1006-
if(-1 != ret) {
1007-
if(rand_enough())
1008-
return CURLE_OK;
1009-
}
1010-
}
1011-
#endif
1012-
1013999
/* fallback to a custom seeding of the PRNG using a hash based on a current
10141000
time */
10151001
do {

m4/curl-openssl.m4

-12
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,6 @@ if test "x$OPT_OPENSSL" != xno; then
259259
if test X"$OPENSSL_ENABLED" = X"1"; then
260260
dnl These can only exist if OpenSSL exists
261261
262-
AC_CHECK_FUNCS( RAND_egd )
263-
264262
AC_MSG_CHECKING([for BoringSSL])
265263
AC_COMPILE_IFELSE([
266264
AC_LANG_PROGRAM([[
@@ -363,16 +361,6 @@ dnl Check for the random seed preferences
363361
dnl **********************************************************************
364362
365363
if test X"$OPENSSL_ENABLED" = X"1"; then
366-
AC_ARG_WITH(egd-socket,
367-
AS_HELP_STRING([--with-egd-socket=FILE],
368-
[Entropy Gathering Daemon socket pathname]),
369-
[ EGD_SOCKET="$withval" ]
370-
)
371-
if test -n "$EGD_SOCKET" ; then
372-
AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
373-
[your Entropy Gathering Daemon socket pathname] )
374-
fi
375-
376364
dnl Check for user-specified random device
377365
AC_ARG_WITH(random,
378366
AS_HELP_STRING([--with-random=FILE],

packages/vms/gnv_conftest.c_first

-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ char SSL_connect(void) {return 0;}
3333
char ENGINE_init(void) {return 0;}
3434
char RAND_status(void) {return 0;}
3535
/* char RAND_screen(void) {return 0;} In headers, but not present */
36-
char RAND_egd(void) {return 0;}
3736
char CRYPTO_cleanup_all_ex_data(void) {return 0;}
3837
char SSL_get_shutdown(void) {return 0;}
3938
char ENGINE_load_builtin_engines (void) {return 0;}
@@ -46,7 +45,6 @@ char ENGINE_load_builtin_engines (void) {return 0;}
4645
#define ENGINE_init ENGINE_INIT
4746
#define RAND_status RAND_STATUS
4847
/* #define RAND_screen RAND_SCREEN */
49-
#define RAND_egd RAND_EGD
5048
#define CRYPTO_cleanup_all_ex_data CRYPTO_CLEANUP_ALL_EX_DATA
5149
#define SSL_get_shutdown SSL_GET_SHUTDOWN
5250
#define ENGINE_load_builtin_engines ENGINE_LOAD_BUILTIN_ENGINES

scripts/ciconfig.pl

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
'zstd' => 1,
8484
'brotli' => 1,
8585
'random' => 1,
86-
'egd-socket' => 1,
8786
'ca-bundle' => 1,
8887
'ca-path' => 1,
8988
'libssh2' => 1,

0 commit comments

Comments
 (0)