fa8b248
From c293c4a99ef27e210014b4c87f0330df40571a4c Mon Sep 17 00:00:00 2001
bc092b9
From: Peter Jones <pjones@redhat.com>
bc092b9
Date: Mon, 9 May 2016 14:15:17 -0400
fa8b248
Subject: [PATCH 170/198] Add some grub_dprintf() in the secure boot verify
bc092b9
 code.
bc092b9
bc092b9
Signed-off-by: Peter Jones <pjones@redhat.com>
bc092b9
---
bc092b9
 grub-core/loader/efi/linux.c | 16 +++++++++++++---
bc092b9
 1 file changed, 13 insertions(+), 3 deletions(-)
bc092b9
bc092b9
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
bc092b9
index 2a7024134..7fe7201a3 100644
bc092b9
--- a/grub-core/loader/efi/linux.c
bc092b9
+++ b/grub-core/loader/efi/linux.c
bc092b9
@@ -43,12 +43,22 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size)
bc092b9
   shim_lock = grub_efi_locate_protocol(&guid, NULL);
bc092b9
   grub_dprintf ("secureboot", "shim_lock: %p\n", shim_lock);
bc092b9
   if (!shim_lock)
bc092b9
-    return 0;
bc092b9
+    {
bc092b9
+      grub_dprintf ("secureboot", "shim not available\n");
bc092b9
+      return 0;
bc092b9
+    }
bc092b9
 
bc092b9
-  status = shim_lock->verify(data, size);
bc092b9
+  grub_dprintf ("secureboot", "Asking shim to verify kernel signature\n");
bc092b9
+  status = shim_lock->verify (data, size);
bc092b9
   grub_dprintf ("secureboot", "shim_lock->verify(): %ld\n", status);
bc092b9
   if (status == GRUB_EFI_SUCCESS)
bc092b9
-    return 1;
bc092b9
+    {
bc092b9
+      grub_dprintf ("secureboot", "Kernel signature verification passed\n");
bc092b9
+      return 1;
bc092b9
+    }
bc092b9
+
bc092b9
+  grub_dprintf ("secureboot", "Kernel signature verification failed (0x%lx)\n",
bc092b9
+		(unsigned long) status);
bc092b9
 
bc092b9
   return -1;
bc092b9
 }
bc092b9
-- 
fa8b248
2.14.3
bc092b9