[PATCH] Random: Modification in random_init

Prameela Rani Garnepudi prameela.gatsamsung.com
Mon Mar 24 01:05:18 PDT 2014


In random_init return from the function immediately if random_entropy_file
is NULL. Because, the process of creating random_fd socket and thus,
eloop socket is unnecessary as the content read from /dev/random shall
be written to random_entropy_file which is NULL.

Signed-off-by: Prameela Rani Garnepudi <prameela.g at samsung.com>
---
 src/crypto/random.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/crypto/random.c b/src/crypto/random.c
index 053740e..121200e 100644
--- a/src/crypto/random.c
+++ b/src/crypto/random.c
@@ -409,6 +409,8 @@ void random_init(const char *entropy_file)
                random_entropy_file = os_strdup(entropy_file);
        else
                random_entropy_file = NULL;
+       if (!random_entropy_file)
+               return;
        random_read_entropy();

 #ifdef __linux__
--
1.7.6.5


Thanks,
Prameela
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Random-Modification-in-random_init.patch
Type: application/octet-stream
Size: 1018 bytes
Desc: not available
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20140324/d1e8ab3f/attachment.obj>



More information about the Hostap mailing list