efi/libstub: refactor the initrd measuring functions
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Fri, 16 Sep 2022 08:14:34 +0000 (11:14 +0300)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 27 Sep 2022 11:26:16 +0000 (13:26 +0200)
commit566331696329c2f9ca0fe2a55a5dd029ac43d2d2
tree5816c1342a48e9c9714e733e03d66857e938b343
parent24e88ab0448814be43fc2781f3b54d7a73083345
efi/libstub: refactor the initrd measuring functions

Currently, from the efi-stub, we are only measuring the loaded initrd,
using the TCG2 measured boot protocols.  A following patch is
introducing measurements of additional components, such as the kernel
command line. On top of that, we will shortly have to support other
types of measured boot that don't expose the TCG2 protocols.

So let's prepare for that, by rejigging the efi_measure_initrd() routine
into something that we should be able to reuse for measuring other
assets, and which can be extended later to support other measured boot
protocols.

Co-developed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/efi-stub-helper.c