summaryrefslogtreecommitdiffhomepage
path: root/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'random.c')
-rw-r--r--random.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/random.c b/random.c
index f1475ed..cd0ac31 100644
--- a/random.c
+++ b/random.c
@@ -27,6 +27,13 @@
#include "dbutil.h"
#include "bignum.h"
+#ifdef DROPBEAR_RANDOM_DEV
+const char* random_dev = DROPBEAR_RANDOM_DEV;
+#else
+const char* random_dev = NULL;
+#endif
+
+
static int donerandinit = 0;
/* this is used to generate unique output from the same hashpool */
@@ -62,9 +69,9 @@ static void readrand(unsigned char* buf, unsigned int buflen) {
#endif
#ifdef DROPBEAR_RANDOM_DEV
- readfd = open(DROPBEAR_RANDOM_DEV, O_RDONLY);
+ readfd = open(random_dev, O_RDONLY);
if (readfd < 0) {
- dropbear_exit("couldn't open random device");
+ dropbear_exit("couldn't open %s", random_dev);
}
#endif