Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load concatenated EFI_SIGNATURE_LISTs from shim_certificate.efi
For multiple reasons, it may be useful for different keys to be used to sign different parts of the boot chain (e.g. a different key for GRUB and the Linux kernel). Allow this by loading concatenated EFI_SIGNATURE_LISTs from shim_certificate.efi rather than only the first. At the same time, be a bit more robust by checking for allocation failures and overflows due to invalid data in the binary. Use the smaller of VirtualSize and SizeOfRawData since the latter is rounded up to the section alignment and therefore may contain non-certificate data. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
- Loading branch information
2daf1db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this. FWIW I debugged this before I saw your fix and was able to use Section->Misc.VirtualSize and just copy the whole thing.
Since I still had test binaries around I ran a quick test and confirmed that your math ends up with the same user_cert_size and the same data in user_cert.
I'm mostly leaving this note here in case something else changes and the simplified copy becomes useful.