mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
util/nvmutil: err if arc4random disused on bsd
arc4random is superior, so using /dev/urandom would be a mistake. we only use that on linux, or old/weird unix. we would also use it on linux, but GNU prohibits nice things (its implementations are spotty, and old glibc doesn't have it - before 2022 there is libbsd, but i'm not importing that). not that it matters. we're not doing encryption. i'm just a stickler for technical correctness. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -268,9 +268,15 @@ main(int argc, char *argv[])
|
||||
if (cmd_index == CMD_SETMAC)
|
||||
printf("Randomisation method: arc4random_buf\n");
|
||||
#else
|
||||
#if defined(__OpenBSD__) || defined(__FreeBSD__) || \
|
||||
defined(__NetBSD__) || defined(__APPLE__) || \
|
||||
defined(__DragonFly__)
|
||||
err(ECANCELED, "Maintainer error: arc4random disabled on BSD/MacOS");
|
||||
#endif
|
||||
if (cmd_index == CMD_SETMAC)
|
||||
open_dev_urandom();
|
||||
#endif
|
||||
|
||||
open_gbe_file();
|
||||
|
||||
#ifdef __OpenBSD__
|
||||
|
||||
Reference in New Issue
Block a user