diff options
Diffstat (limited to 'random.c')
-rw-r--r-- | random.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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 |