Refactor EGD conditional support

As per Jeremy's request in #124
Windows does not define HAVE_RAND_EGD resulting in the same conditional
support for EGD.
This commit is contained in:
Bernard Spil
2015-04-21 10:04:08 +02:00
parent 828f4f4fb1
commit 858480145b
6 changed files with 3 additions and 10 deletions

View File

@@ -79,7 +79,6 @@ while(<>) {
if ("$(DIR_hdbdir)") { print "#define HDB_DB_DIR \"".'$(DIR_hdbdir)'."\"\n"; } if ("$(DIR_hdbdir)") { print "#define HDB_DB_DIR \"".'$(DIR_hdbdir)'."\"\n"; }
if ("$(HAVE_MSLSA_CACHE)") { print "#define HAVE_MSLSA_CACHE 1\n"; } if ("$(HAVE_MSLSA_CACHE)") { print "#define HAVE_MSLSA_CACHE 1\n"; }
if ("$(NO_LOCALNAME)") { print "#define NO_LOCALNAME 1\n"; } if ("$(NO_LOCALNAME)") { print "#define NO_LOCALNAME 1\n"; }
if ("$(NO_RAND_EGD_METHOD)") { print "#define NO_RAND_EGD_METHOD 1\n"; }
} elsif (m/\@VERSION_OPTDEFS\@/) { } elsif (m/\@VERSION_OPTDEFS\@/) {

View File

@@ -1363,9 +1363,6 @@ static const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg }
/* Define if you don't want to use mmap. */ /* Define if you don't want to use mmap. */
#define NO_MMAP 1 #define NO_MMAP 1
/* Define if EGD rand method is not defined */
#define NO_RAND_EGD_METHOD 1
/* Define if the Unix rand method is not defined */ /* Define if the Unix rand method is not defined */
#define NO_RAND_UNIX_METHOD 1 #define NO_RAND_UNIX_METHOD 1

View File

@@ -486,7 +486,7 @@ fortuna_reseed(void)
entropy_p = 1; entropy_p = 1;
} }
#endif #endif
#if !defined(NO_RAND_EGD_METHOD) && defined(HAVE_RAND_EGD) #if defined(HAVE_RAND_EGD)
/* /*
* Only to get egd entropy if /dev/random or arc4rand failed since * Only to get egd entropy if /dev/random or arc4rand failed since
* it can be horribly slow to generate new bits. * it can be horribly slow to generate new bits.

View File

@@ -125,7 +125,7 @@ main(int argc, char **argv)
else if (strcasecmp(rand_method, "unix") == 0) else if (strcasecmp(rand_method, "unix") == 0)
RAND_set_rand_method(RAND_unix_method()); RAND_set_rand_method(RAND_unix_method());
#endif #endif
#if !defined(NO_RAND_EGD_METHOD) && defined(HAVE_RAND_EGD) #if defined(HAVE_RAND_EGD)
else if (strcasecmp(rand_method, "egd") == 0) else if (strcasecmp(rand_method, "egd") == 0)
RAND_set_rand_method(RAND_egd_method()); RAND_set_rand_method(RAND_egd_method());
#endif #endif

View File

@@ -67,7 +67,7 @@ seed_something(void)
/* Calling RAND_status() will try to use /dev/urandom if it exists so /* Calling RAND_status() will try to use /dev/urandom if it exists so
we do not have to deal with it. */ we do not have to deal with it. */
if (RAND_status() != 1) { if (RAND_status() != 1) {
#if !defined(NO_RAND_EGD_METHOD) && defined(HAVE_RAND_EGD) #if defined(HAVE_RAND_EGD)
krb5_context context; krb5_context context;
const char *p; const char *p;

View File

@@ -95,9 +95,6 @@ WEAK_CRYPTO=1
# Disable use of GSS LOCALNAME support # Disable use of GSS LOCALNAME support
NO_LOCALNAME=1 NO_LOCALNAME=1
# No entropy-gathering daemon on Windows
NO_RAND_EGD_METHOD=1
# Windows CRT mkdir does not have the mode parameter # Windows CRT mkdir does not have the mode parameter
MKDIR_DOES_NOT_HAVE_MODE=1 MKDIR_DOES_NOT_HAVE_MODE=1