diff options
Diffstat (limited to 'entropy.c')
-rw-r--r-- | entropy.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -45,7 +45,7 @@ | |||
45 | * XXX: we should tell the child how many bytes we need. | 45 | * XXX: we should tell the child how many bytes we need. |
46 | */ | 46 | */ |
47 | 47 | ||
48 | RCSID("$Id: entropy.c,v 1.41 2002/03/11 00:16:35 stevesk Exp $"); | 48 | RCSID("$Id: entropy.c,v 1.42 2002/04/18 12:53:27 djm Exp $"); |
49 | 49 | ||
50 | #ifndef OPENSSL_PRNG_ONLY | 50 | #ifndef OPENSSL_PRNG_ONLY |
51 | #define RANDOM_SEED_SIZE 48 | 51 | #define RANDOM_SEED_SIZE 48 |
@@ -61,6 +61,7 @@ seed_rng(void) | |||
61 | pid_t pid; | 61 | pid_t pid; |
62 | int ret; | 62 | int ret; |
63 | unsigned char buf[RANDOM_SEED_SIZE]; | 63 | unsigned char buf[RANDOM_SEED_SIZE]; |
64 | mysig_t old_sigchld; | ||
64 | 65 | ||
65 | if (RAND_status() == 1) { | 66 | if (RAND_status() == 1) { |
66 | debug3("RNG is ready, skipping seeding"); | 67 | debug3("RNG is ready, skipping seeding"); |
@@ -74,6 +75,7 @@ seed_rng(void) | |||
74 | if (pipe(p) == -1) | 75 | if (pipe(p) == -1) |
75 | fatal("pipe: %s", strerror(errno)); | 76 | fatal("pipe: %s", strerror(errno)); |
76 | 77 | ||
78 | old_sigchld = mysignal(SIGCHLD, SIG_DFL); | ||
77 | if ((pid = fork()) == -1) | 79 | if ((pid = fork()) == -1) |
78 | fatal("Couldn't fork: %s", strerror(errno)); | 80 | fatal("Couldn't fork: %s", strerror(errno)); |
79 | if (pid == 0) { | 81 | if (pid == 0) { |
@@ -113,6 +115,7 @@ seed_rng(void) | |||
113 | if (waitpid(pid, &ret, 0) == -1) | 115 | if (waitpid(pid, &ret, 0) == -1) |
114 | fatal("Couldn't wait for ssh-rand-helper completion: %s", | 116 | fatal("Couldn't wait for ssh-rand-helper completion: %s", |
115 | strerror(errno)); | 117 | strerror(errno)); |
118 | mysignal(SIGCHLD, old_sigchld); | ||
116 | 119 | ||
117 | /* We don't mind if the child exits upon a SIGPIPE */ | 120 | /* We don't mind if the child exits upon a SIGPIPE */ |
118 | if (!WIFEXITED(ret) && | 121 | if (!WIFEXITED(ret) && |