summaryrefslogtreecommitdiffstats
path: root/src/shared/pe-binary.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Introduce systemd-sbsign to do secure boot signingDaan De Meyer2024-11-061-2/+49
| | | | | | | | | | | | | | | | | | | | | | | Currently in mkosi and ukify we use sbsigntools to do secure boot signing. This has multiple issues: - sbsigntools is practically unmaintained, sbvarsign is completely broken with the latest gnu-efi when built without -fshort-wchar and upstream has completely ignored my bug report about this. - sbsigntools only supports openssl engines and not the new providers API. - sbsigntools doesn't allow us to cache hardware token pins in the kernel keyring like we do nowadays when we sign stuff ourselves in systemd-repart or systemd-measure There are alternative tools like sbctl and pesign but these do not support caching hardware token pins in the kernel keyring either. To get around the issues with sbsigntools, let's introduce our own tool systemd-sbsign to do secure boot signing. This allows us to take advantage of our own openssl infra so that hardware token pins are cached in the kernel keyring as expected and we get openssl provider support as well.
* pcrlock: Move pe_hash() and uki_hash() to pe-binary.hDaan De Meyer2024-11-051-1/+267
| | | | | Let's move these to shared so we can reuse pe_hash() in the upcoming systemd-sbsign.
* pe-binary: add pe_is_native() for checking if PE is nativeLennart Poettering2024-09-121-0/+11
|
* pe-binary: split pe_header_find_section() in twoLennart Poettering2024-09-121-5/+14
| | | | | | | | This splits out the core part into a new function pe_section_table_find(). pe_header_find_section() takes a PeHeader as input, while pe_section_table_find() just takes the section table and its size.
* pe-binary: split pe_read_section_data() into twoLennart Poettering2024-09-121-21/+31
| | | | | | This renames pe_read_section_data() to pe_read_section_data_by_name() and makes pe_read_section_data() a bit more low-level: it takes a header table entry directly, instead of searching it first by name.
* pe-binary: add helper pe_is_addon() for detecting whether we are looking at ↵Lennart Poettering2024-09-121-0/+14
| | | | PE EFI add-on
* pe-binary: .initrd section is optional for UKIYu Watanabe2024-05-161-2/+3
| | | | | | | .osrel is also optional, but sd-boot and bootctl requires it. So, let's keep .osrel section at least now. Fixes #32774.
* pe-binary: actually check if PE binary is UEFI binary when determining if UKILennart Poettering2023-09-291-0/+3
| | | | If it's not a UEFI binary, then it's not a UKI.
* shared: add common implementation of PE parserLennart Poettering2023-08-291-0/+238