712866
From e590f5beec5bc282898e38b8d1016288cfc4af9f Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Fri, 8 Nov 2013 15:06:18 +0100
712866
Subject: [PATCH] fips: fix RHEV vmlinuz check
712866
712866
---
712866
 modules.d/01fips/fips.sh | 12 ++++++------
712866
 1 file changed, 6 insertions(+), 6 deletions(-)
712866
712866
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
5c6c2a
index 98dd1c2f..7fa48f13 100755
712866
--- a/modules.d/01fips/fips.sh
712866
+++ b/modules.d/01fips/fips.sh
712866
@@ -60,8 +60,8 @@ do_rhevh_check()
712866
     KERNEL=$(uname -r)
712866
     kpath=${1}
712866
 
712866
-    # If we're on RHEV-H, the kernel is in /dev/.initramfs/live/vmlinuz0
712866
-    HMAC_SUM_ORIG=$(cat /boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done)
712866
+    # If we're on RHEV-H, the kernel is in /run/initramfs/live/vmlinuz0
712866
+    HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done)
712866
     HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b; do printf "%s\n" $a; done || return 1)
712866
     if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
712866
         warn "HMAC sum mismatch"
712866
@@ -111,10 +111,10 @@ do_fips()
712866
     rmmod tcrypt
712866
 
712866
     info "Checking integrity of kernel"
712866
-    if [ -e "$NEWROOT/dev/.initramfs/live/vmlinuz0" ]; then
712866
-        do_rhevh_check "$NEWROOT/dev/.initramfs/live/vmlinuz0" || return 1
712866
-    elif [ -e "$NEWROOT/dev/.initramfs/live/isolinux/vmlinuz0" ]; then
712866
-        do_rhevh_check "$NEWROOT/dev/.initramfs/live/isolinux/vmlinuz0" || return 1
712866
+    if [ -e "/run/initramfs/live/vmlinuz0" ]; then
712866
+        do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
712866
+    elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
712866
+        do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
712866
     else
712866
         sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
712866
     fi