- (djm) Fix some bugs I introduced into ssh-rand-helper yesterday

This commit is contained in:
Damien Miller 2002-01-22 21:58:27 +11:00
parent 6c21c51c48
commit c46cc5445d
2 changed files with 7 additions and 10 deletions

View File

@ -6,6 +6,7 @@
the ssh-rand-helper program. You can force the use of ssh-rand-helper
using the --with-rand-helper configure argument
- Simplify and clean up ssh-rand-helper configuration
- (djm) Fix some bugs I introduced into ssh-rand-helper yesterday
20020121
- (djm) Rework ssh-rand-helper:
@ -7153,4 +7154,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
$Id: ChangeLog,v 1.1722 2002/01/22 10:57:53 djm Exp $
$Id: ChangeLog,v 1.1723 2002/01/22 10:58:27 djm Exp $

View File

@ -39,7 +39,7 @@
#include "pathnames.h"
#include "log.h"
RCSID("$Id: ssh-rand-helper.c,v 1.3 2002/01/21 12:44:12 djm Exp $");
RCSID("$Id: ssh-rand-helper.c,v 1.4 2002/01/22 10:58:28 djm Exp $");
/* Number of bytes we write out */
#define OUTPUT_SEED_SIZE 48
@ -83,9 +83,7 @@ char *__progname;
# define RUSAGE_CHILDREN 0
#endif
#if defined(PRNGD_SOCKET) || defined(PRNGD_PORT)
# define USE_PRNGD
#else
#if !defined(PRNGD_SOCKET) && !defined(PRNGD_PORT)
# define USE_SEED_FILES
#endif
@ -774,13 +772,11 @@ main(int argc, char **argv)
(int)stir_from_system());
#ifdef PRNGD_PORT
if (get_random_bytes_prngd(buf, sizeof(buf), PRNGD_PORT,
NULL) == -1)
if (get_random_bytes_prngd(buf, sizeof(buf), PRNGD_PORT, NULL) == -1)
fatal("Entropy collection failed");
RAND_add(buf, sizeof(buf), sizeof(buf));
#elif PRNGD_SOCKET
if (get_random_bytes_prngd(buf, sizeof(buf), PRNGD_SOCKET,
NULL) == -1)
#elif defined(PRNGD_SOCKET)
if (get_random_bytes_prngd(buf, sizeof(buf), 0, PRNGD_SOCKET) == -1)
fatal("Entropy collection failed");
RAND_add(buf, sizeof(buf), sizeof(buf));
#else