Commit Graph

29 Commits (01ffcf342ae65984c655f10a2fd35019a492ee5c)

Author SHA1 Message Date
Renaud Métrich 01ffcf342a fips: removed false-positive 'FATAL: Module xxx not found' error message when kernel provides a generic algo for module
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2018-11-15 10:46:24 +01:00
Lukas Nykryn d818986db4 01fips: Properly fix creating path to .hmac of kernel based on BOOT_IMAGE
8f5c5 broke the case where BOOT_IMAGE is not set at all.
This code should handle following:
1) BOOT_IMAGE not set
2) BOOT_IMAGE set to something unrelated (s390)
3) BOOT_IMAGE=vmlinuz-4.14.7-300.fc27.x86_64
4) BOOT_IMAGE=/vmlinuz-4.14.7-300.fc27.x86_64
5) BOOT_IMAGE=/boot/vmlinuz-4.14.7-300.fc27.x86_64
6) BOOT_IMAGE=subdir/vmlinuz-4.14.7-300.fc27.x86_64
7) BOOT_IMAGE=/subdir/vmlinuz-4.14.7-300.fc27.x86_64
8) BOOT_IMAGE=/boot/subdir/vmlinuz-4.14.7-300.fc27.x86_64

https://bugzilla.redhat.com/show_bug.cgi?id=1415032
2017-12-28 09:59:48 +01:00
Lukas Nykryn 8f5c564cb3 01fips: Fix creating path to .hmac of kernel based on BOOT_IMAGE
Old code did not work for two most common use-cases.
On most machines BOOT_IMAGE is set to something like
/vmlinuz-4.11.3-202.fc25.x86_64. So if we just add prefix "/boot/."
it won't work. Also on machines without /boot on separate partition
BOOT_IMAGE already has the /boot/ prefix (/boot/vmlinuz-3.10.0-799.el7.x86_64).
So let's strip it in such case.

https://bugzilla.redhat.com/show_bug.cgi?id=1415032
2017-12-18 14:48:59 +01:00
Harald Hoyer 3d875f77f3 Try BOOT_IMAGE and fallback to vmlinuz-${KERNEL}
On s390 BOOT_IMAGE only denotes the number of the boot record that
was selected in the bootloader and not the path to the kernel image.

Also only bail out, if the kernel hmac checking relies on that path.
2017-06-29 10:40:29 +02:00
Harald Hoyer 4693daa5fa fips: honor $BOOT_IMAGE variable for HMAC check of the kernel
https://bugzilla.redhat.com/show_bug.cgi?id=1415032
2017-01-30 09:25:41 +01:00
Harald Hoyer 6d58fa27a4 change "while read x" to cope with EOF without newline
while read x || [ -n "$x" ]

should do the trick
2015-04-28 11:39:15 +02:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
Harald Hoyer 928da57447 fips: fix RHEV vmlinuz check 2013-12-03 16:21:04 +01:00
Harald Hoyer 4d7c18c7c0 Handle crypto modules with and without modaliases
If new kernels have modules split out, handle the case, where modules
have to modalias and just install them.

Also add the crypto drivers and names to host_modalias.
2013-10-30 12:24:37 +01:00
Harald Hoyer 190047f161 fips: handle checksum checks for RHEV kernels
https://bugzilla.redhat.com/show_bug.cgi?id=947729
2013-07-31 11:31:13 +02:00
Harald Hoyer 748867d177 fips: cope with module aliases, when checking modules
Also do not fail, if module aliases try to load CPU specific modules
like crc32c_intel.
2013-07-31 11:26:46 +02:00
Harald Hoyer 1e057b352a add PARTLABEL and PARTUUID 2013-07-05 15:32:38 +02:00
Harald Hoyer 32bd2fbb4c use "rm --" to guard against filenames beginning with "-" 2013-06-28 10:31:18 +02:00
Harald Hoyer 26a077fc7e fips: do not fail immediatly after loading the crypto modules
Fail only if tcrypt insmod failed.
2013-04-29 11:34:26 +02:00
Harald Hoyer 6f4c2dada4 fixed fips mode
- preserve timestamps
- copy /lib*/hmaccalc files
- run sha512hmac after kernel module loading
- add more fips kernel modules
2013-04-25 19:44:01 +02:00
Harald Hoyer 0fc0dcff60 bye bye iscsi_wait_scan ... officially gone for kernel 3.6 2012-09-18 13:39:54 +02:00
Harald Hoyer c9a9968dfc fips: set /boot as symlink to /sysroot/boot if no boot= parameter
otherwise sha512hmac will error out with:

sha512hmac -c /sysroot/boot/.vmlinuz-2.6.32-220.el6.x86_64.hmac
Error opening "/boot/vmlinuz-2.6.32-220.el6.x86_64": No such file or directory.
2012-08-21 18:46:20 +02:00
Harald Hoyer 4257798f8a fips: forward port RHEL-6 fips changes
- also support FIPS on separate LVM partition
- use small settle loop to get /boot
- "set -e" has no effect, if we use "||"
- make fips work with encrypted root and seperate boot
- moved to pre-pivot to support /boot in /
2011-05-02 11:15:46 +02:00
Harald Hoyer d125a47061 mkdir always with -m 0755 2011-04-08 10:39:46 +02:00
Harald Hoyer 02c1bd6bb6 fips: add "rd.fips.skipkernel" boot option 2011-04-08 10:27:32 +02:00
Harald Hoyer 01583ae4ad fips: fixed "boot=<dev>" handling 2011-03-30 14:57:01 +02:00
Harald Hoyer 10b5dca0f7 fips/fips.sh: do not load tcrypt with "noexit" parameter
"noexit=1" is the default mode for the tcrypt module now.

[forward ported 7e7308158c9149c33309c0d36a6e1126e690fb58]
2011-03-07 13:37:20 +01:00
Harald Hoyer b60d5e90a5 fips/fips.sh: die(), if boot=<device> is not present or has wrong format 2011-03-07 13:37:19 +01:00
Harald Hoyer 674bdee804 fips/fips.sh: only trigger udev, if device node of boot is not present 2011-03-07 13:37:19 +01:00
Harald Hoyer e2d86d001a fips: s/==/= 2011-01-03 09:48:37 +01:00
Harald Hoyer cc02093d69 reformat source code
removed tabs and set indention to 4 spaces
added emacs and vi format headers
2010-09-10 15:34:36 +02:00
Harald Hoyer 719cc30626 fips: udev trigger with action=add 2010-08-05 08:47:17 +02:00
Harald Hoyer c2bcc5be2f fips: add shebang to fips.sh 2009-11-27 14:31:05 +01:00
Harald Hoyer 03d8ec2601 add module fips 2009-11-12 14:59:28 +01:00