mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-07-24 09:34:15 +00:00

Per Peter Jones suggestion, we will be flexible in what data we expect while parsing the variable. Three fields are mandatory: component_generation, component_name_size, component_name However we also support adding comments and additional information to be added after component name, with ',' as a separator. Those information will be ignored and not used for verification purposes. So: grub,1 and grub,1,wow,this,is,my,comment will provide exactly same set of data for verification. [0]: https://github.com/rhboot/shim/blob/main/SBAT.md Signed-off-by: Alex Burmashev <alexander.burmashev@oracle.com> Signed-off-by: Peter Jones <pjones@redhat.com>
33 lines
777 B
C
33 lines
777 B
C
// SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
/*
|
|
* sbat.c - parse SBAT data from the .rsrc section data
|
|
*/
|
|
|
|
#ifndef SBAT_H_
|
|
#define SBAT_H_
|
|
|
|
struct sbat_var {
|
|
const CHAR8 *component_name;
|
|
const CHAR8 *component_generation;
|
|
list_t list;
|
|
};
|
|
|
|
EFI_STATUS parse_sbat_var(list_t *entries);
|
|
void cleanup_sbat_var(list_t *entries);
|
|
|
|
struct sbat_entry {
|
|
const CHAR8 *component_name;
|
|
const CHAR8 *component_generation;
|
|
const CHAR8 *vendor_name;
|
|
const CHAR8 *vendor_package_name;
|
|
const CHAR8 *vendor_version;
|
|
const CHAR8 *vendor_url;
|
|
};
|
|
|
|
EFI_STATUS parse_sbat(char *sbat_base, size_t sbat_size, size_t *sbats, struct sbat_entry ***sbat);
|
|
|
|
EFI_STATUS verify_sbat(size_t n, struct sbat_entry **entries, list_t *var_entries);
|
|
|
|
#endif /* !SBAT_H_ */
|
|
// vim:fenc=utf-8:tw=75:noet
|