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