]> Savannah Git Hosting - gnulib.git/commit
getrandom-tests: do not assume GRND_RANDOM yields short read
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Jun 2020 06:29:21 +0000 (23:29 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Jun 2020 06:30:39 +0000 (23:30 -0700)
commite3c038e4c08d68cc3ca03cf0c3dc09c3182e216a
treebc3b8caf3e94dfc25d83fc0b9215ae9785b628e8
parent8f8da7c809b6908d074ac64c91d0cedfd4236f2e
getrandom-tests: do not assume GRND_RANDOM yields short read

* tests/test-getrandom.c (main): Omit assertion that
getrandom (b, sizeof b, GRND_RANDOM | GRND_NONBLOCK) < sizeof b
when b’s size is 100000.  This assertion fails with Linux kernel
5.6.13, as that kernel ignores the GRND_RANDOM flag.
The separate blocking pool is going away in the Linux kernel, and
they’ve added a flag GRND_INSECURE instead; see:
https://lore.kernel.org/linux-api/705c5a091b63cc5da70c99304bb97e0109be0a26.1577088521.git.luto@kernel.org/
The assertion was iffy anyway; what’s to prevent a kernel from
lazily filling a large buffer with random bytes?
ChangeLog
tests/test-getrandom.c