summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-08 02:34:26 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-08 02:34:26 +0000
commit9bd7d04b49464f2c9d368c5d24451a5638b4751d (patch)
tree0a8a0be1c3da74952940fad82882e27393f61ece /util
parentc1bfe6a4387f6a699b4665e5266caf888e0e0dcf (diff)
util/nvmutil: say what randomiser is used
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 914525f2..65c1b0eb 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -248,7 +248,10 @@ main(int argc, char *argv[])
}
#endif
-#ifndef HAVE_ARC4RANDOM_BUF
+#ifdef HAVE_ARC4RANDOM_BUF
+ if (cmd == CMD_SETMAC)
+ printf("Randomisation method: arc4random_buf\n");
+#else
open_dev_urandom();
#endif
open_gbe_file();
@@ -404,6 +407,9 @@ open_dev_urandom(void)
{
struct stat st_urandom_fd;
+ if (cmd == CMD_SETMAC)
+ printf("Randomisation method: %s\n", newrandom);
+
/*
* Try /dev/urandom first
*/
@@ -411,6 +417,10 @@ open_dev_urandom(void)
if ((urandom_fd = open(rname, O_RDONLY)) != -1)
return;
+ if (cmd == CMD_SETMAC)
+ fprintf(stderr, "Can't open %s (will use %s instead)\n",
+ newrandom, oldrandom);
+
/*
* Fall back to /dev/random on old platforms
* where /dev/urandom does not exist.