summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/rand.c
AgeCommit message (Collapse)Author
8 hourslibreboot-utils: add dragonflybsd to arc4randommkhtemp-wipLeah Rowe
it supports arc4random since forever Signed-off-by: Leah Rowe <leah@libreboot.org>
8 hourslibreboot-utils: usleep 100 on rand failureLeah Rowe
it's extremely unlikely that a 2nd call would also fail. this is fine. it mitigates DoS attacks (entropy exhaustion) Signed-off-by: Leah Rowe <leah@libreboot.org>
8 hourslibreboot-utils: tidy up the rand codeLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 hoursutil/mkhtemp: allow zero as a rand valueLeah Rowe
yes, zero is a valid response. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 hoursutil/libreboot-utils: simplified randLeah Rowe
only use the getrandom syscall on linux, or arc4random. the /dev/urandom fallback is removed, and we use the syscall; failure is almost certainly unlikely, but if it fails, we abort. this provides therefore the same guarantee as bsd arc4random, since it will never return under fault conditions. it will only ever return success, or abort. nobody should be using /dev/urandom in 2026. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 hourslibreboot-utils: remove 1989 randLeah Rowe
added as an academic exercise, but pointless in the year 2026. or even the year 1989. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 hourslibreboot-utils: move rand to own fileLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>