]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: capsule: Remove the check for capsule_authentication_enabled environment...
authorSughosh Ganu <sughosh.ganu@linaro.org>
Mon, 12 Apr 2021 15:05:23 +0000 (20:35 +0530)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 18 May 2021 10:36:12 +0000 (12:36 +0200)
The current capsule authentication code checks if the environment
variable capsule_authentication_enabled is set, for authenticating the
capsule. This is in addition to the check for the config symbol
CONFIG_EFI_CAPSULE_AUTHENTICATE. Remove the check for the environment
variable. The capsule will now be authenticated if the config symbol
is set.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviwed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
board/emulation/common/qemu_capsule.c
lib/efi_loader/efi_firmware.c

index 5cb461d52bcef233d224b1bf6a99f1f6235a1fbc..6b8a87022a4c08707f8f69932707e23a5c6f5ba3 100644 (file)
@@ -41,9 +41,3 @@ int efi_get_public_key_data(void **pkey, efi_uintn_t *pkey_len)
 
        return 0;
 }
-
-bool efi_capsule_auth_enabled(void)
-{
-       return env_get("capsule_authentication_enabled") != NULL ?
-               true : false;
-}
index 7a3cca279364ecf4bd4877884523d50c93266f15..a1b88dbfc286692b1d51ae5e7313c068c0a9f1e6 100644 (file)
@@ -190,7 +190,7 @@ static efi_status_t efi_get_dfu_info(
                                IMAGE_ATTRIBUTE_IMAGE_UPDATABLE;
 
                /* Check if the capsule authentication is enabled */
-               if (env_get("capsule_authentication_enabled"))
+               if (IS_ENABLED(CONFIG_EFI_CAPSULE_AUTHENTICATE))
                        image_info[0].attributes_setting |=
                                IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED;
 
@@ -421,8 +421,7 @@ efi_status_t EFIAPI efi_firmware_raw_set_image(
                return EFI_EXIT(EFI_INVALID_PARAMETER);
 
        /* Authenticate the capsule if authentication enabled */
-       if (IS_ENABLED(CONFIG_EFI_CAPSULE_AUTHENTICATE) &&
-           env_get("capsule_authentication_enabled")) {
+       if (IS_ENABLED(CONFIG_EFI_CAPSULE_AUTHENTICATE)) {
                capsule_payload = NULL;
                capsule_payload_size = 0;
                status = efi_capsule_authenticate(image, image_size,