mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-19 09:32:27 +02:00
@@ -59,7 +59,7 @@ retry_rand:
|
|||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
retry_rand:
|
retry_rand:
|
||||||
if ((rc = (ssize_t)syscall(SYS_getrandom,
|
if ((rc = (ssize_t)syscall(SYS_getrandom,
|
||||||
buf + off, n - off, 0)) < 0) {
|
(unsigned char *)buf + off, n - off, 0)) < 0) {
|
||||||
#else
|
#else
|
||||||
#error Unsupported operating system (possibly unsecure randomisation)
|
#error Unsupported operating system (possibly unsecure randomisation)
|
||||||
#endif
|
#endif
|
||||||
@@ -80,6 +80,10 @@ retry_rand:
|
|||||||
|
|
||||||
goto out;
|
goto out;
|
||||||
err:
|
err:
|
||||||
|
/* since arc4random always returns
|
||||||
|
* successful, we treat urandom/getrandom
|
||||||
|
* failures as fatal and abort accordingly
|
||||||
|
*/
|
||||||
err_no_cleanup(1, ECANCELED,
|
err_no_cleanup(1, ECANCELED,
|
||||||
"Randomisation failure, possibly unsupported in your kernel.");
|
"Randomisation failure, possibly unsupported in your kernel.");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|||||||
Reference in New Issue
Block a user