Message ID | 20200401003426.7198-4-erichte@linux.ibm.com |
---|---|
State | Superseded |
Headers | show |
Series | Add initial secure variable storage and backend drivers | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch master (6826095796c91583f344950ff76ef8ccf6e756b5) |
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot | success | Test snowpatch/job/snowpatch-skiboot on branch master |
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco | success | Signed-off-by present |
diff --git a/libstb/secvar/secvar_devtree.c b/libstb/secvar/secvar_devtree.c index 4bff1392..5dbd872e 100644 --- a/libstb/secvar/secvar_devtree.c +++ b/libstb/secvar/secvar_devtree.c @@ -64,3 +64,18 @@ void secvar_set_update_status(uint64_t val) dt_add_property_u64(secvar_node, "update-status", val); } +bool secvar_check_physical_presence(void) +{ + struct dt_node *secureboot; + + secureboot = dt_find_by_path(dt_root, "ibm,secureboot"); + if (!secureboot) + return false; + + if (dt_find_property(secureboot, "clear-os-keys") + || dt_find_property(secureboot, "clear-all-keys") + || dt_find_property(secureboot, "clear-mfg-keys")) + return true; + + return false; +} diff --git a/libstb/secvar/secvar_devtree.h b/libstb/secvar/secvar_devtree.h index d3838849..b88162bf 100644 --- a/libstb/secvar/secvar_devtree.h +++ b/libstb/secvar/secvar_devtree.h @@ -10,4 +10,6 @@ void secvar_init_devnode(const char *compatible); void secvar_set_status(const char *status); void secvar_set_update_status(uint64_t val); +bool secvar_check_physical_presence(void); + #endif
This patch adds a simple function to detect whether or not physical presence has been asserted. In the current implementation, all physical presence assertion modes are treated the same. Signed-off-by: Eric Richter <erichte@linux.ibm.com> --- libstb/secvar/secvar_devtree.c | 15 +++++++++++++++ libstb/secvar/secvar_devtree.h | 2 ++ 2 files changed, 17 insertions(+)