1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/lib/util/tests
Volker Lendecke e73ccc06ef Rely on /dev/urandom
This removes quite a bit of code. All reasonable systems have /dev/urandom
these days. Linux, Solaris and the BSDs do.  In case we find a system
without /dev/urandom, we will have to go hunting in other libraries.

The main reason for this is speed: On Ubuntu 14.04 doing direct reads from
/dev/urandom is 2-3 times faster than our md4 based code. On virtualized
FreeBSD 10 the difference is even larger.

My first approach was to use fopen/fread. It was even faster, but less
than twice as fast. So I thought we could save the additional complexity
when having to deal with throwing away buffers when forking and the
additional memory footprint per process.

With this simple generate_random_buffer it will be easier to adapt new
syscalls to get randomness.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 13 04:25:39 CEST 2015 on sn-devel-104
2015-10-13 04:25:38 +02:00
..
anonymous_shared.c lib/util: add tests for anonymous_shared_allocate/free() 2011-01-20 06:25:03 +01:00
asn1_tests.c lib/util/tests: avoid some compiler warnings 2014-11-14 23:27:04 +01:00
data_blob.c lib/util/tests: add missing #include "torture/local/proto.h" 2014-04-02 09:03:44 +02:00
dlinklist.c lib/util/tests: add missing #include "torture/local/proto.h" 2014-04-02 09:03:44 +02:00
file.c lib: Fix a few CIDs for Resource Leak 2015-04-21 19:37:16 +02:00
genrand.c Rely on /dev/urandom 2015-10-13 04:25:38 +02:00
genrandperf.c lib: Add a little tool to perftest generate_random_buffer() 2015-10-13 01:23:07 +02:00
idtree.c lib/util/tests: add missing #include "torture/local/proto.h" 2014-04-02 09:03:44 +02:00
str.c lib/util/tests: add missing #include "torture/local/proto.h" 2014-04-02 09:03:44 +02:00
strlist.c lib/util/tests: avoid some compiler warnings 2014-11-14 23:27:04 +01:00
time.c lib/util/tests: add missing #include "torture/local/proto.h" 2014-04-02 09:03:44 +02:00