efi: test/py: authenticate fit capsules
authorVincent Stehlé <vincent.stehle@arm.com>
Tue, 31 May 2022 07:55:34 +0000 (09:55 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 4 Jun 2022 06:43:55 +0000 (08:43 +0200)
commit8645aefc8b699f900d97cbadd55b7f492099c61e
tree8b9b58da4604290897131f8cb7fd70ab0ded7b3a
parent82b3f4cb46ce8ef49b6b887233be0b409056d6c4
efi: test/py: authenticate fit capsules

Add support for the authentication of UEFI capsules containing FIT images.

The authentication code is moved out of the function handling raw images
into a new function efi_firmware_capsule_authenticate(). The special case
for the FMP header coming from edk2 tools is preserved. There is no
functional change for capsules containing raw images.

The python test for signed capsules with raw images is renamed with no
functional change and a new test is added for signed capsules containing
FIT images.

This can be tested with sandbox64_defconfig or sandbox_flattree_defconfig,
plus CONFIG_EFI_CAPSULE_AUTHENTICATE=y.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_firmware.c
test/py/tests/test_efi_capsule/conftest.py
test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py [new file with mode: 0644]
test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py [moved from test/py/tests/test_efi_capsule/test_capsule_firmware_signed.py with 98% similarity]