Allow insecure boot mode to bypass kexec sig checks

There was a bug in the "force" boot mode where it would still fail if
signatures didn't match. This was because the check_config function
validates the signatures for kexec files. I've added a few conditionals
here so that in the case of a forced boot mode, we can bypass those
signature checks that would prevent boot and error out to a recovery
console.
This commit is contained in:
Kyle Rankin 2018-03-14 10:18:52 -07:00
parent 21a3059c5f
commit 665754122d
No known key found for this signature in database
GPG Key ID: 555577116BFA74B9
2 changed files with 10 additions and 4 deletions

View File

@ -294,7 +294,11 @@ do_boot()
}
while true; do
check_config $paramsdir
if [ "$force_boot" = "y" ]; then
check_config $paramsdir force
else
check_config $paramsdir
fi
TMP_DEFAULT_FILE=`find /tmp/kexec/kexec_default.*.txt 2>/dev/null | head -1` || true
TMP_MENU_FILE="/tmp/kexec/kexec_menu.txt"
TMP_HASH_FILE="/tmp/kexec/kexec_hashes.txt"

View File

@ -181,9 +181,11 @@ check_config() {
return
fi
if ! sha256sum `find $1/kexec*.txt` | gpgv $1/kexec.sig - ; then
die 'Invalid signature on kexec boot params'
fi
if [ "$2" != "force" ]; then
if ! sha256sum `find $1/kexec*.txt` | gpgv $1/kexec.sig - ; then
die 'Invalid signature on kexec boot params'
fi
fi
echo "+++ Found verified kexec boot params"
cp $1/kexec*.txt /tmp/kexec \