]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: fix boot_service_capability_min calculation
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Fri, 3 Sep 2021 01:55:51 +0000 (10:55 +0900)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 4 Sep 2021 10:03:57 +0000 (12:03 +0200)
TCG EFI Protocol Specification requires to the input
ProtocolCapability.Size < size of the EFI_TCG2_BOOT_SERVICE_CAPABILITY
up to and including the vendor ID field.
Current implementation does different calculation, let's fix it.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
include/efi_tcg2.h

index b6b958da514f324a0a27b6a31b44b0dbc4a3c859..a8c43e415f386e56c42c5ed7524641831e7da127 100644 (file)
@@ -127,8 +127,8 @@ struct efi_tcg2_boot_service_capability {
        efi_tcg_event_algorithm_bitmap active_pcr_banks;
 };
 
+/* up to and including the vendor ID (manufacturer_id) field */
 #define boot_service_capability_min \
-       sizeof(struct efi_tcg2_boot_service_capability) - \
        offsetof(struct efi_tcg2_boot_service_capability, number_of_pcr_banks)
 
 #define TCG_EFI_SPEC_ID_EVENT_SIGNATURE_03 "Spec ID Event03"