mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-21 19:26:22 +02:00
util/nvmutil: say what randomiser is used
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+11
-1
@@ -248,7 +248,10 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_ARC4RANDOM_BUF
|
#ifdef HAVE_ARC4RANDOM_BUF
|
||||||
|
if (cmd == CMD_SETMAC)
|
||||||
|
printf("Randomisation method: arc4random_buf\n");
|
||||||
|
#else
|
||||||
open_dev_urandom();
|
open_dev_urandom();
|
||||||
#endif
|
#endif
|
||||||
open_gbe_file();
|
open_gbe_file();
|
||||||
@@ -404,6 +407,9 @@ open_dev_urandom(void)
|
|||||||
{
|
{
|
||||||
struct stat st_urandom_fd;
|
struct stat st_urandom_fd;
|
||||||
|
|
||||||
|
if (cmd == CMD_SETMAC)
|
||||||
|
printf("Randomisation method: %s\n", newrandom);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try /dev/urandom first
|
* Try /dev/urandom first
|
||||||
*/
|
*/
|
||||||
@@ -411,6 +417,10 @@ open_dev_urandom(void)
|
|||||||
if ((urandom_fd = open(rname, O_RDONLY)) != -1)
|
if ((urandom_fd = open(rname, O_RDONLY)) != -1)
|
||||||
return;
|
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
|
* Fall back to /dev/random on old platforms
|
||||||
* where /dev/urandom does not exist.
|
* where /dev/urandom does not exist.
|
||||||
|
|||||||
Reference in New Issue
Block a user