coreboot/util/smmstoretool/vs.h
Benjamin Doron a6fbaa47ea util/smmstoretool: Clarify the auth_vars field
We want to distinguish between a variable store that's marked as capable
of storing authenticated variables (basically, checking their signatures
and promising that there's no TOCTOU possible), and a variable with the
authentication-checking enabled.

Change-Id: Ibf6ffbe279961ff54b0988d98a912a8421598e3b
Signed-off-by: Benjamin Doron <benjamin.doron@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88423
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2025-07-17 18:13:56 +00:00

44 lines
981 B
C

/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef SMMSTORETOOL__VS_H__
#define SMMSTORETOOL__VS_H__
#include <stdbool.h>
#include "udk2017.h"
#include "utils.h"
// Variable store is part of firmware volume. This unit doesn't deal with its
// header only with data that follows.
struct var_t {
uint8_t reserved;
uint32_t attrs;
EFI_GUID guid;
CHAR16 *name;
size_t name_size; // in bytes
uint8_t *data;
size_t data_size; // in bytes
struct var_t *next;
};
struct var_store_t {
struct var_t *vars;
bool is_auth_var_store;
};
struct var_store_t vs_load(struct mem_range_t vs_data, bool is_auth_var_store);
bool vs_store(struct var_store_t *vs, struct mem_range_t vs_data);
struct var_t *vs_new_var(struct var_store_t *vs);
struct var_t *vs_find(struct var_store_t *vs,
const char name[],
const EFI_GUID *guid);
void vs_delete(struct var_store_t *vs, struct var_t *var);
void vs_free(struct var_store_t *vs);
#endif // SMMSTORETOOL__VS_H__