aboutsummaryrefslogtreecommitdiffstats
path: root/src/librandom/random_buf_early.c
Commit message (Collapse)AuthorAgeFilesLines
* Save/restore errno in all safe wrappersLaurent Bercot2026-01-011-0/+3
|
* Don't use arc4random() for early random on LinuxLaurent Bercot2022-07-231-1/+1
| | | | Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Add runtime fallback for GRND_INSECURELaurent Bercot2022-06-231-3/+13
| | | | | | | | | | | | | | | | | | | The grndinsecure sysdep is only build-time tested and returns yes if the kernel headers declare GRND_INSECURE. That is a problem because the kernel headers are most likely provided by the toolchain and do not reflect the exact capabilities of the run-time kernel. If the run-time kernel doesn't support that option, getrandom() fails. That made random_buf_early() busyloop. To avoid that, we now fallback to random_devurandom() as an implementation of random_buf_early() if getrandom() fails when used with GRND_INSECURE. This adds a slight amount of overhead to random_buf_early(), so it's probably better to just disable the sysdep at build time if you're making binaries that will run on older kernels. Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Export random_devurandom, fix APIsLaurent Bercot2022-06-081-1/+1
| | | | Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Prepare for 2.12.0.0. librandom revamp.Laurent Bercot2022-04-091-0/+54
Signed-off-by: Laurent Bercot <ska@appnovation.com>