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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c
index e6c52b546..68b77b208 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.8 2002/07/28 20:42:24 stevesk Exp $"); 42RCSID("$Id: ssh-rand-helper.c,v 1.10 2003/03/17 05:13:53 djm 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
@@ -355,6 +355,7 @@ hash_command_output(entropy_cmd_t *src, unsigned char *hash)
355 case 0: 355 case 0:
356 /* timer expired */ 356 /* timer expired */
357 error_abort = 1; 357 error_abort = 1;
358 kill(pid, SIGINT);
358 break; 359 break;
359 case 1: 360 case 1:
360 /* command input */ 361 /* command input */
@@ -561,7 +562,8 @@ prng_write_seedfile(void)
561 562
562 debug("writing PRNG seed to file %.100s", filename); 563 debug("writing PRNG seed to file %.100s", filename);
563 564
564 RAND_bytes(seed, sizeof(seed)); 565 if (RAND_bytes(seed, sizeof(seed)) <= 0)
566 fatal("PRNG seed extration failed");
565 567
566 /* Don't care if the seed doesn't exist */ 568 /* Don't care if the seed doesn't exist */
567 prng_check_seedfile(filename); 569 prng_check_seedfile(filename);
@@ -848,7 +850,8 @@ main(int argc, char **argv)
848 if (!RAND_status()) 850 if (!RAND_status())
849 fatal("Not enough entropy in RNG"); 851 fatal("Not enough entropy in RNG");
850 852
851 RAND_bytes(buf, bytes); 853 if (RAND_bytes(buf, bytes) <= 0)
854 fatal("Couldn't extract entropy from PRNG");
852 855
853 if (output_hex) { 856 if (output_hex) {
854 for(ret = 0; ret < bytes; ret++) 857 for(ret = 0; ret < bytes; ret++)