fips: honor $BOOT_IMAGE variable for HMAC check of the kernel

https://bugzilla.redhat.com/show_bug.cgi?id=1415032
master
Harald Hoyer 2017-01-30 09:20:55 +01:00
parent 7c29d205f4
commit 4693daa5fa
1 changed files with 5 additions and 4 deletions

View File

@ -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"