efi_loader: efi_tcg2_register returns appropriate error
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Tue, 7 Dec 2021 05:15:31 +0000 (14:15 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 9 Dec 2021 19:43:25 +0000 (11:43 -0800)
commit54bec17f6b0326bbc22f993d28170d4c4df4ceed
tree8abef9e20ff7c5496c62ee7f730590733b77c6e3
parent446266b024c971a6afa4eb256b2995a245d4eb49
efi_loader: efi_tcg2_register returns appropriate error

This commit modify efi_tcg2_register() to return the
appropriate error.
With this fix, sandbox will not boot because efi_tcg2_register()
fails due to some missing feature in GetCapabilities.
So disable sandbox if EFI_TCG2_PROTOCOL is enabled.

UEFI secure boot variable measurement is not directly related
to TCG2 protocol installation, tcg2_measure_secure_boot_variable()
is moved to the separate function.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
include/efi_loader.h
lib/efi_loader/Kconfig
lib/efi_loader/efi_setup.c
lib/efi_loader/efi_tcg2.c