efi_loader: error message if image not authenticated
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 27 Aug 2020 15:51:32 +0000 (17:51 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 6 Sep 2020 19:21:41 +0000 (21:21 +0200)
Currently if the bootefi command fails due to missing authentication, the
user gets no feedback.

Write a log message 'Image not authenticated' if LoadImage() fails due to
missing authentication.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_image_loader.c

index da50fc3..94f76ef 100644 (file)
@@ -762,10 +762,12 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle,
        }
 
        /* Authenticate an image */
-       if (efi_image_authenticate(efi, efi_size))
+       if (efi_image_authenticate(efi, efi_size)) {
                handle->auth_status = EFI_IMAGE_AUTH_PASSED;
-       else
+       } else {
                handle->auth_status = EFI_IMAGE_AUTH_FAILED;
+               log_err("Image not authenticated\n");
+       }
 
        /* Calculate upper virtual address boundary */
        for (i = num_sections - 1; i >= 0; i--) {