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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c
index 6412d44e2..4da62a724 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.21 2005/02/16 02:02:45 djm Exp $"); 42RCSID("$Id: ssh-rand-helper.c,v 1.22 2005/02/16 02:20:07 dtucker 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
@@ -888,3 +888,15 @@ main(int argc, char **argv)
888 888
889 return ret == bytes ? 0 : 1; 889 return ret == bytes ? 0 : 1;
890} 890}
891
892/*
893 * We may attempt to re-seed during mkstemp if we are using the one in the
894 * compat library (via mkstemp -> arc4random -> seed_rng) so we need
895 * our own seed_rng(). We must also check that we have enough entropy.
896 */
897void
898seed_rng(void)
899{
900 if (!RAND_status())
901 fatal("Not enough entropy in RNG");
902}