Commit graph

5 commits

Author SHA1 Message Date
Thomas Devoogdt
cb57abb46f seedrng: fix for glibc <= 2.24 not providing random header
- dropped the wrong define (not sure why it was there)
 - <sys/random.h> not available if glibc <= 2.24
 - GRND_NONBLOCK not defined if <sys/random.h> not included
 - ret < 0 && errno == ENOSYS has to be true to get creditable set

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-11 13:56:12 +02:00
Denys Vlasenko
200a9669fb seedrng: fix for glibc <= 2.24 not providing getrandom()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-10 17:26:04 +02:00
Denys Vlasenko
67fd6be0bb seedrng: do not hash in a constant string, it's not adding entropy
function                                             old     new   delta
seedrng_main                                         906     880     -26
.rodata                                           104899  104873     -26
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-52)             Total: -52 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-05-03 12:48:50 +02:00
Denys Vlasenko
3bfbcb5807 seedrng: restore error check on fsync
Or else security people will never stop nagging us.

function                                             old     new   delta
seedrng_main                                         884     906     +22

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-05-02 15:03:32 +02:00
Denys Vlasenko
5ba56e8b95 seedrng: it's not a part of util-linux, move to miscutils
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-05-02 14:53:14 +02:00
Renamed from util-linux/seedrng.c (Browse further)