summaryrefslogtreecommitdiff
path: root/rnd.c
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-06-04 12:01:56 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-06-04 12:01:56 +0200
commit7ea4576392b014490e6308ad82d695cc85a0b8bd (patch)
tree82b2c8d497acfa9c2b1e8f3d75f1153d00583a62 /rnd.c
parentb1d59d3eda7ee4f09b30f807d72aac2af58409ac (diff)
rnd: move entropy source definition to rnd
It's better off there anyway. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'rnd.c')
-rw-r--r--rnd.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/rnd.c b/rnd.c
index ad32175..3a7481d 100644
--- a/rnd.c
+++ b/rnd.c
@@ -13,7 +13,7 @@ static void randombytes(unsigned char *x, unsigned long long xlen)
if (fd_rnd == -1) {
for (;;) {
- fd_rnd = open("/dev/urandom", O_RDONLY);
+ fd_rnd = open(LOW_ENTROPY_SOURCE, O_RDONLY);
if (fd_rnd != -1)
break;
sleep(1);
@@ -37,10 +37,6 @@ static void randombytes(unsigned char *x, unsigned long long xlen)
}
}
-/* Note: it's not really secure, but the name only suggests it's better to use
- * than rand(3) when transferring bytes over the network in non-security
- * critical structure members. secrand() is only used to fill up salts actually.
- */
int secrand(void)
{
int ret;