From 73322ba087d10d06b0656816bf4b7ba80b02c751 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 23 Feb 2021 10:25:00 -0500 Subject: SBAT: make our SBAT variable parser use the CSV parser This makes our SBAT variable parser use the generic CSV parser, and also changes its API slightly to produce a more testable intermediate interface. Signed-off-by: Peter Jones --- include/sbat.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sbat.h b/include/sbat.h index 7aec3b78..c3e96179 100644 --- a/include/sbat.h +++ b/include/sbat.h @@ -8,13 +8,22 @@ extern UINTN _sbat, _esbat; -struct sbat_var { +struct sbat_var_entry { const CHAR8 *component_name; const CHAR8 *component_generation; + /* + * This column is only actually on the "sbat" version entry + */ + const CHAR8 *sbat_datestamp; list_t list; }; extern list_t sbat_var; +#define SBAT_VAR_COLUMNS ((sizeof (struct sbat_var_entry) - sizeof(list_t)) / sizeof(CHAR8 *)) +#define SBAT_VAR_REQUIRED_COLUMNS (SBAT_VAR_COLUMNS - 1) +#ifdef SHIM_UNIT_TEST +EFI_STATUS parse_sbat_var_data(list_t *entries, UINT8 *data, UINTN datasize); +#endif EFI_STATUS parse_sbat_var(list_t *entries); void cleanup_sbat_var(list_t *entries); -- cgit v1.2.3