e83cdd
From 14310ca42f06c2156ab5cefd05dbaa47ae3b054d Mon Sep 17 00:00:00 2001
e83cdd
From: Jonathan Lebon <jonathan@jlebon.com>
e83cdd
Date: Tue, 29 Oct 2019 16:47:34 -0400
e83cdd
Subject: [PATCH] 01fips: run sha512hmac from directory HMAC file directory
e83cdd
e83cdd
That way, the HMAC file can contain a relative path instead of an
e83cdd
absolute one. The issue is that right now the kernel RPM bakes the
e83cdd
`/boot/vmlinuz-${kver}` path into the HMAC file which poses an issue for
e83cdd
rpm-ostree systems (and any other system where the kernel isn't simply
e83cdd
in the top-level `/boot`.
e83cdd
e83cdd
For now, we're hacking around this in rpm-ostree:
e83cdd
https://github.com/coreos/rpm-ostree/pull/1934
e83cdd
e83cdd
Though I'd like to propose the same change in the kernel spec file.
e83cdd
---
e83cdd
 modules.d/01fips/fips.sh | 2 +-
e83cdd
 1 file changed, 1 insertion(+), 1 deletion(-)
e83cdd
e83cdd
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
e83cdd
index c3dbcf74..893143d0 100755
e83cdd
--- a/modules.d/01fips/fips.sh
e83cdd
+++ b/modules.d/01fips/fips.sh
e83cdd
@@ -135,7 +135,7 @@ do_fips()
e83cdd
             return 1
e83cdd
         fi
e83cdd
 
e83cdd
-        sha512hmac -c "${BOOT_IMAGE_HMAC}" || return 1
e83cdd
+        (cd "${BOOT_IMAGE_HMAC%/*}" && sha512hmac -c "${BOOT_IMAGE_HMAC}") || return 1
e83cdd
     fi
e83cdd
 
e83cdd
     info "All initrd crypto checks done"
e83cdd