aboutsummaryrefslogtreecommitdiff
path: root/libstb/Makefile.inc
diff options
context:
space:
mode:
authorEric Richter <erichte@linux.ibm.com>2019-11-05 01:37:56 -0600
committerOliver O'Halloran <oohall@gmail.com>2019-11-07 17:46:33 +1100
commit484bdc5dda042ba46c84975a94eacb77e77e35e8 (patch)
tree94a67f28309c2757abd91f65e0f92faf2e072c4a /libstb/Makefile.inc
parent04f0cdb9bbb04f0d6295165a3a218d6d234dbee6 (diff)
downloadskiboot-484bdc5dda042ba46c84975a94eacb77e77e35e8.zip
skiboot-484bdc5dda042ba46c84975a94eacb77e77e35e8.tar.gz
skiboot-484bdc5dda042ba46c84975a94eacb77e77e35e8.tar.bz2
libstb/secvar: add secure variable internal abstraction
This patch implements a platform-independent abstraction for storing and retrieving secure variables, as required for host OS secure boot. This serves as the main entry point for initializing the in-memory cache of the secure variables, which also kicks off any platform-specific logic that may be needed. This patch also provides core functions for the subsequent patches in this series to utilize. The base secure variable implementation makes use of two types of drivers, to be selected by the platform: "storage" drivers, and "backend" drivers. The storage driver implements the hooks required to write the secure variables to some form of non-volatile memory, and load the variables on boot. The backend driver defines how the variables should be interpreted, and processed. Secure variables are stored in two types of banks, the "variable" bank and the "update" bank. Variables that have been validated and processed are stored in the variable bank. This bank is effectively read-only after the base secvar initialization. Any proposed variable updates are instead stored in the update bank. During secvar initialization, the backend driver processes variables from the update bank, and if valid, adds the new variable to the variable bank. NOTE: The name "backend" is subject to change. It operates more like a scheme, so unless a better name comes along, it will likely change to "scheme" or "schema" in the future. Signed-off-by: Eric Richter <erichte@linux.ibm.com> [oliver: added missing SPDX tags, removed unused definitions, style fixes] Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- V2: - added secvar device tree node as child of ibm,secureboot - added version and compatible properties to backend driver struct - added secvar_ready flag for the API to detect if secvar initialized successfully - moved pre-process step to after initial variable load - moved flags field from secvar struct to secvar node V3: - remove the metadata secvar field - add probe_secvar() to bump compatible flag - add device tree property for backend-agnostic secure mode setting - remove backend minor version field - remove static data allocation in secvar struct V4: - add alloc_secvar helpers - removed ibm,secureboot version bump to v3 - secvars now store their allocated size seperate from the data size (to permit overallocating) - split device tree functions into their own file - device tree changes: - secvar now a child of ibm,opal - compatible is "ibm,secvar-v1", backend creates its own node - secure-mode is now a boolean os-secure-enforcing property - storage and backends now have their own nodes V5: - removed storage device tree subnode - moved max-var-size to secvar node - added max-var-key-len - fixed SPDX header in include/secvar.h - removed obsolete enum - removed unused devtree wrappers - set secvar status prop earlier V6: - moved os-secureboot-enforcing to ibm,secureboot - set secvar compatible based on backend - removed backend node
Diffstat (limited to 'libstb/Makefile.inc')
-rw-r--r--libstb/Makefile.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/libstb/Makefile.inc b/libstb/Makefile.inc
index 6d54c5c..d3f6849 100644
--- a/libstb/Makefile.inc
+++ b/libstb/Makefile.inc
@@ -8,11 +8,12 @@ LIBSTB_SRCS = container.c tpm_chip.c cvc.c secureboot.c trustedboot.c
LIBSTB_OBJS = $(LIBSTB_SRCS:%.c=%.o)
LIBSTB = $(LIBSTB_DIR)/built-in.a
+include $(SRC)/$(LIBSTB_DIR)/secvar/Makefile.inc
include $(SRC)/$(LIBSTB_DIR)/mbedtls/Makefile.inc
include $(SRC)/$(LIBSTB_DIR)/drivers/Makefile.inc
include $(SRC)/$(LIBSTB_DIR)/tss/Makefile.inc
-$(LIBSTB): $(LIBSTB_OBJS:%=$(LIBSTB_DIR)/%) $(DRIVERS) $(TSS) $(MBEDTLS)
+$(LIBSTB): $(LIBSTB_OBJS:%=$(LIBSTB_DIR)/%) $(DRIVERS) $(TSS) $(SECVAR) $(MBEDTLS)
libstb/create-container: libstb/create-container.c libstb/container-utils.c
$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) \