summaryrefslogtreecommitdiff
path: root/ssh-rand-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-rand-helper.c')
-rw-r--r--ssh-rand-helper.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c
index 364d5d270..e6c52b546 100644
--- a/ssh-rand-helper.c
+++ b/ssh-rand-helper.c
@@ -39,7 +39,7 @@
39#include "pathnames.h" 39#include "pathnames.h"
40#include "log.h" 40#include "log.h"
41 41
42RCSID("$Id: ssh-rand-helper.c,v 1.7 2002/06/09 19:41:49 mouring Exp $"); 42RCSID("$Id: ssh-rand-helper.c,v 1.8 2002/07/28 20:42:24 stevesk Exp $");
43 43
44/* Number of bytes we write out */ 44/* Number of bytes we write out */
45#define OUTPUT_SEED_SIZE 48 45#define OUTPUT_SEED_SIZE 48
@@ -63,7 +63,6 @@ RCSID("$Id: ssh-rand-helper.c,v 1.7 2002/06/09 19:41:49 mouring Exp $");
63# define SSH_PRNG_COMMAND_FILE SSHDIR "/ssh_prng_cmds" 63# define SSH_PRNG_COMMAND_FILE SSHDIR "/ssh_prng_cmds"
64#endif 64#endif
65 65
66
67#ifdef HAVE___PROGNAME 66#ifdef HAVE___PROGNAME
68extern char *__progname; 67extern char *__progname;
69#else 68#else
@@ -115,7 +114,7 @@ double stir_from_programs(void);
115double stir_gettimeofday(double entropy_estimate); 114double stir_gettimeofday(double entropy_estimate);
116double stir_clock(double entropy_estimate); 115double stir_clock(double entropy_estimate);
117double stir_rusage(int who, double entropy_estimate); 116double stir_rusage(int who, double entropy_estimate);
118double hash_command_output(entropy_cmd_t *src, char *hash); 117double hash_command_output(entropy_cmd_t *src, unsigned char *hash);
119int get_random_bytes_prngd(unsigned char *buf, int len, 118int get_random_bytes_prngd(unsigned char *buf, int len,
120 unsigned short tcp_port, char *socket_path); 119 unsigned short tcp_port, char *socket_path);
121 120
@@ -274,7 +273,7 @@ timeval_diff(struct timeval *t1, struct timeval *t2)
274} 273}
275 274
276double 275double
277hash_command_output(entropy_cmd_t *src, char *hash) 276hash_command_output(entropy_cmd_t *src, unsigned char *hash)
278{ 277{
279 char buf[8192]; 278 char buf[8192];
280 fd_set rdset; 279 fd_set rdset;
@@ -460,7 +459,7 @@ stir_from_programs(void)
460{ 459{
461 int c; 460 int c;
462 double entropy, total_entropy; 461 double entropy, total_entropy;
463 char hash[SHA_DIGEST_LENGTH]; 462 unsigned char hash[SHA_DIGEST_LENGTH];
464 463
465 total_entropy = 0; 464 total_entropy = 0;
466 for(c = 0; entropy_cmds[c].path != NULL; c++) { 465 for(c = 0; entropy_cmds[c].path != NULL; c++) {
@@ -543,7 +542,8 @@ void
543prng_write_seedfile(void) 542prng_write_seedfile(void)
544{ 543{
545 int fd; 544 int fd;
546 char seed[SEED_FILE_SIZE], filename[MAXPATHLEN]; 545 unsigned char seed[SEED_FILE_SIZE];
546 char filename[MAXPATHLEN];
547 struct passwd *pw; 547 struct passwd *pw;
548 548
549 pw = getpwuid(getuid()); 549 pw = getpwuid(getuid());
@@ -862,4 +862,3 @@ main(int argc, char **argv)
862 862
863 return ret == bytes ? 0 : 1; 863 return ret == bytes ? 0 : 1;
864} 864}
865