summaryrefslogtreecommitdiffstats
path: root/entropy.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-05-17 22:08:29 +1000
committerDamien Miller <djm@mindrot.org>2000-05-17 22:08:29 +1000
commitf3c6cf13837e24ab6ac7b19567bff00dd6c1b161 (patch)
treefd3ef2e56ec206ea35b47e7ccbe7d5a2307ce54e /entropy.c
parentd2c208a2d37104c5c429659ac708d6288400ecd2 (diff)
- Avoid WCOREDUMP complation errors for systems that lack it
- Avoid SIGCHLD warnings from entropy commands
Diffstat (limited to 'entropy.c')
-rw-r--r--entropy.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/entropy.c b/entropy.c
index 79ef93ac..cc7e8152 100644
--- a/entropy.c
+++ b/entropy.c
@@ -35,7 +35,7 @@
#include <openssl/rand.h>
#include <openssl/sha.h>
-RCSID("$Id: entropy.c,v 1.10 2000/05/17 11:34:08 damien Exp $");
+RCSID("$Id: entropy.c,v 1.11 2000/05/17 12:08:30 damien Exp $");
#ifdef EGD_SOCKET
#ifndef offsetof
@@ -735,18 +735,26 @@ prng_seed_cleanup(void *junk)
void
seed_rng(void)
{
+ void *old_sigchld_handler;
+
if (!prng_commands_loaded) {
if (!prng_read_commands(SSH_PRNG_COMMAND_FILE))
fatal("PRNG initialisation failed -- exiting.");
prng_commands_loaded = 1;
}
+ /* Make sure some other sigchld handler doesn't reap our entropy */
+ /* commands */
+ old_sigchld_handler = signal(SIGCHLD, SIG_DFL);
+
debug("Seeding random number generator.");
debug("OpenSSL random status is now %i\n", RAND_status());
debug("%i bytes from system calls", (int)stir_from_system());
debug("%i bytes from programs", (int)stir_from_programs());
debug("OpenSSL random status is now %i\n", RAND_status());
+ signal(SIGCHLD, old_sigchld_handler);
+
if (!RAND_status())
fatal("Couldn't initialise builtin random number generator -- exiting.");