Blame SOURCES/0503-fips-honor-BOOT_IMAGE-variable-for-HMAC-check-of-the.patch

5c6c2a
From 17092b128ce6900e0600dbdaf4ac9c777af0db2e Mon Sep 17 00:00:00 2001
5c6c2a
From: Harald Hoyer <harald@redhat.com>
5c6c2a
Date: Mon, 30 Jan 2017 09:20:55 +0100
5c6c2a
Subject: [PATCH] fips: honor $BOOT_IMAGE variable for HMAC check of the kernel
5c6c2a
5c6c2a
https://bugzilla.redhat.com/show_bug.cgi?id=1415032
5c6c2a
5c6c2a
Cherry-picked from: 4693daa5fa7dddc6b35825831f35657cb66bd531
5c6c2a
Resolves: #1415032
5c6c2a
---
5c6c2a
 modules.d/01fips/fips.sh | 9 +++++----
5c6c2a
 1 file changed, 5 insertions(+), 4 deletions(-)
5c6c2a
5c6c2a
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
5c6c2a
index 0b69a823..e9ed00b5 100755
5c6c2a
--- a/modules.d/01fips/fips.sh
5c6c2a
+++ b/modules.d/01fips/fips.sh
5c6c2a
@@ -79,9 +79,10 @@ do_fips()
5c6c2a
     local _module
5c6c2a
 
5c6c2a
     KERNEL=$(uname -r)
5c6c2a
-
5c6c2a
-    if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
5c6c2a
-        warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
5c6c2a
+    BOOT_IMAGE="$(getarg BOOT_IMAGE)"
5c6c2a
+    BOOT_IMAGE="${BOOT_IMAGE:-/vmlinuz-${KERNEL}}"
5c6c2a
+    if ! [ -e "/boot/.${BOOT_IMAGE}.hmac" ] && ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
5c6c2a
+        warn "/boot/.${BOOT_IMAGE}.hmac does not exist"
5c6c2a
         return 1
5c6c2a
     fi
5c6c2a
 
5c6c2a
@@ -116,7 +117,7 @@ do_fips()
5c6c2a
     elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
5c6c2a
         do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
5c6c2a
     else
5c6c2a
-        sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
5c6c2a
+        sha512hmac -c "/boot/.${BOOT_IMAGE}.hmac" || return 1
5c6c2a
     fi
5c6c2a
 
5c6c2a
     info "All initrd crypto checks done"