summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-02-23 10:25:00 -0500
committerPeter Jones <pjones@redhat.com>2021-02-25 10:15:14 -0500
commit73322ba087d10d06b0656816bf4b7ba80b02c751 (patch)
treecef07132684ac1b9d079eea70184f0dc8d1b831c /include
parent6168b48258b8fd0c66be42a09e5612e41c908408 (diff)
downloadefi-boot-shim-73322ba087d10d06b0656816bf4b7ba80b02c751.tar.gz
efi-boot-shim-73322ba087d10d06b0656816bf4b7ba80b02c751.zip
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 <pjones@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/sbat.h11
1 files changed, 10 insertions, 1 deletions
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);