summaryrefslogtreecommitdiff
path: root/src/boot/bootctl-random-seed.c
Commit message (Collapse)AuthorAgeFilesLines
* bootctl: 'tmp' is always non-NULLYu Watanabe2023-01-091-2/+2
| | | | Fixes CID#1502330.
* bootctl: fix indentationYu Watanabe2023-01-091-1/+1
|
* bootctl: split out setting of system token into function of its ownLennart Poettering2023-01-041-62/+69
| | | | | Let's break a huge function in two. No code change, just some refactoring.
* bootctl: downgrade graceful messages to LOG_NOTICELennart Poettering2023-01-041-2/+2
|
* sha256: add helper than hashes a buffer *and* its sizeLennart Poettering2023-01-041-4/+2
| | | | | We use this pattern all the time in order to thward extension attacks, add a helper to make it shorter.
* bootctl: when updating EFI random seed file, hash old seed with new oneLennart Poettering2023-01-041-1/+35
| | | | | | Let's not regress in entropy in any case. This does what f913c784ad4c93894fd6cb2590738113dff5a694 also does.
* bootctl: properly sync fs before/after moving random seed file into placeLennart Poettering2023-01-041-1/+8
| | | | | | Let's do a careful, focussed sync at the right places instead of a blanket sync at the end. After all we want to run this on every boot soon.
* bootctl: rework random seed logic to use open_mkdir_at() and openat()Lennart Poettering2023-01-041-28/+29
| | | | | | | | This doesn't really fix anything, but in general we should put stronger emphasis on operating via dir fds rather than paths more (in particular when writing files as opposed to consuming them). No real change in behaviour.
* bootctl: fix errno loggingLennart Poettering2023-01-041-1/+1
|
* tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-191-1/+1
| | | | | | | | | | | | | | | | -1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary.
* bootctl: split out random seed verb, tooLennart Poettering2022-12-191-0/+151