summaryrefslogtreecommitdiffstats
path: root/include/randutils.h
Commit message (Collapse)AuthorAgeFilesLines
* lib/randutils: remove unnecessary functionKarel Zak2016-10-041-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/randutils: add xsrand() and rand_get_number()Karel Zak2016-09-061-0/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mcookie: use lib/randutilsSami Kerola2014-03-261-0/+1
| | | | | | | | | The mcookie should reuse existing code, and there is definitely no need to prefer /dev/random for this utility. See reference for explanation about later statement. References: http://www.2uo.de/myths-about-urandom/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libuuid: avoid double open and leaking fd (reworked)Petr Uzel2012-05-101-1/+1
| | | | | | | | | | | | | | This reverts commit 6126f7a53c57485a9a29ddd772765695f23c92e6 and fixes the double open and leaking descriptor in a different way, that is by using newly introduced function 'have_random_source()' to check whether good random source is available while deciding which uuid type to generate (random/time). This is better than calling random_get_fd() twice, passing the file descriptor down the stack and reusing it in next call to random_get_fd(). Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* libuuid: avoid double open and leaking descriptorPetr Uzel2012-05-041-1/+1
| | | | | | | | | | | | | We are opening /dev/urandom twice in uuid_generate(): first to check if the file is available and then later __uuid_generate_random() again to actually get the random data. Moreover, descriptor from the first open is leaking. Fix by passign the descriptor down the stack and reusing it there. References: http://marc.info/?l=util-linux-ng&m=133406051131131&w=2 Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* lib: random utilitiesDavidlohr Bueso2012-04-101-0/+12
Add a random number(s) generator specific file. The intial functions are based on what libuuid provide. I did some modifications like avoid WIN32 checks - this is util-LINUX. [kzak@redhat.com: - move jrand_seed to lib/randutils.c - use TLS for jrand_seed (like original code from libuuid) - use size_t for buffer sizes - add close() to random_get_bytes] Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>