Commit Graph

6 Commits

Author SHA1 Message Date
Peter Jones
ff890cf452 mok: minor cleanups
Signed-off-by: Peter Jones <pjones@redhat.com>
Upstream-commit-id: 617b9007668
2020-07-23 20:52:12 -04:00
Gary Lin
3d62232feb mok: also mirror the build cert to MokListRT
If the build cert is enabled, we should also mirror it to MokListRT.

Signed-off-by: Gary Lin <glin@suse.com>
Upstream-commit-id: aecbe1f99b6
2020-07-23 20:52:12 -04:00
Peter Jones
ff6e5cda13 mok: consolidate mirroring code in a helper instead of using goto
There's no reason to complicate the logic with a goto here, instead just
pull the logic we're jumping to out to a helper function.

Signed-off-by: Peter Jones <pjones@redhat.com>
Upstream-commit-id: 29c11483101
2020-07-23 20:52:12 -04:00
Gary Lin
f748139695 mok: fix the mirroring of RT variables
When there is no key in MokList, import_mok_state() just skipped MokList
even though it should always mirror the vendor cert. Besides, the faulty
check of 'present' and 'addend' invalidates the mirroring of MokListXRT,
MokSBStateRT, and MokIgnoreDB.

https://github.com/rhboot/shim/issues/154

Signed-off-by: Gary Lin <glin@suse.com>
Upstream-commit-id: 4b27ae034ba
2020-07-23 20:52:12 -04:00
Patrick Uiterwijk
ac0400b202 Make sure that MOK variables always get mirrored
Without this, if a Mok variable doesn't exist in Boot Services, it will also
not be copied to Runtime, even if we have data to be added to it (vendor cert).
This patch makes sure that if we have extra data to append, we still mirror
the variable.

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
Upstream-commit-id: 9ab0d796bdc
2020-07-23 20:52:12 -04:00
Peter Jones
4181a16f62 shim: Make our variable validation and mirroring table driven.
This makes it so shim's idea of Mok variables all resides in one table
of data, and we don't need a bunch of nearly identical ad-hoc functions
to handle each of them.

Signed-off-by: Peter Jones <pjones@redhat.com>
2018-03-12 16:21:43 -04:00