e83cdd
From dcbc74b01bfb360eecadb8e59480472b86fe63d0 Mon Sep 17 00:00:00 2001
e83cdd
From: Jonathan Lebon <jonathan@jlebon.com>
e83cdd
Date: Tue, 29 Oct 2019 09:35:41 -0400
e83cdd
Subject: [PATCH] 01fips: fix HMAC file path resolution
e83cdd
e83cdd
There is a small regression in #343: when handling the 'separate boot
e83cdd
partition' case, we're checking for the kernel image in the wrong
e83cdd
location: `BOOT_IMAGE` is the `/boot`-relative path to the kernel image,
e83cdd
so `/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}` expands to e.g.
e83cdd
`/boot/mysubdir1/mysubdir2/mysubdir1/mysubdir2/vmlinuz...`.
e83cdd
e83cdd
We should be using `BOOT_IMAGE_NAME` here instead (and in fact, the next
e83cdd
if-statement does this correctly, so it might've just been accidentally
e83cdd
left out of #343).
e83cdd
---
e83cdd
 modules.d/01fips/fips.sh | 2 +-
e83cdd
 1 file changed, 1 insertion(+), 1 deletion(-)
e83cdd
e83cdd
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
e83cdd
index beaa692b..c3dbcf74 100755
e83cdd
--- a/modules.d/01fips/fips.sh
e83cdd
+++ b/modules.d/01fips/fips.sh
e83cdd
@@ -118,7 +118,7 @@ do_fips()
e83cdd
 
e83cdd
         if [ -z "$BOOT_IMAGE_NAME" ]; then
e83cdd
             BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
e83cdd
-        elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}" ]; then
e83cdd
+        elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
e83cdd
             #if /boot is not a separate partition BOOT_IMAGE might start with /boot
e83cdd
             BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"}
e83cdd
             #on some achitectures BOOT_IMAGE does not contain path to kernel
e83cdd