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