]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fips: honor $BOOT_IMAGE variable for HMAC check of the kernel
authorHarald Hoyer <harald@redhat.com>
Mon, 30 Jan 2017 08:20:55 +0000 (09:20 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 30 Jan 2017 08:25:41 +0000 (09:25 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=1415032

modules.d/01fips/fips.sh

index 6acdf62a5d7d228c0d235bc736c8ea7af0ef8c3e..1f84526ac0a1575737f146620cb96ef537758919 100755 (executable)
@@ -77,9 +77,10 @@ do_fips()
     local _module
 
     KERNEL=$(uname -r)
-
-    if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
-        warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
+    BOOT_IMAGE="$(getarg BOOT_IMAGE)"
+    BOOT_IMAGE="${BOOT_IMAGE:-/vmlinuz-${KERNEL}}"
+    if ! [ -e "/boot/.${BOOT_IMAGE}.hmac" ] && ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
+        warn "/boot/.${BOOT_IMAGE}.hmac does not exist"
         return 1
     fi
 
@@ -114,7 +115,7 @@ do_fips()
     elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
         do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
     else
-        sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
+        sha512hmac -c "/boot/.${BOOT_IMAGE}.hmac" || return 1
     fi
 
     info "All initrd crypto checks done"