mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-06-14 11:10:31 +00:00

The license statements in our source files were getting to be a giant mess, and mostly they all just say the same thing. I've switched most of it to SPDX labels, but left copyright statements in place (where they were not obviously incorrect copy-paste jobs that I did...). If there's some change here you don't think is valid, let me know and we can fix it up together. Signed-off-by: Peter Jones <pjones@redhat.com>
71 lines
2.2 KiB
C
71 lines
2.2 KiB
C
// SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
#ifndef SHIM_VARIABLES_H
|
|
#define SHIM_VARIABLES_H
|
|
|
|
#include "efiauthenticated.h"
|
|
#include "peimage.h" /* for SHA256_DIGEST_SIZE */
|
|
|
|
#define certlist_for_each_certentry(cl, cl_init, s, s_init) \
|
|
for (cl = (EFI_SIGNATURE_LIST *)(cl_init), s = (s_init); \
|
|
s > 0 && s >= cl->SignatureListSize; \
|
|
s -= cl->SignatureListSize, \
|
|
cl = (EFI_SIGNATURE_LIST *) ((UINT8 *)cl + cl->SignatureListSize))
|
|
|
|
/*
|
|
* Warning: this assumes (cl)->SignatureHeaderSize is zero. It is for all
|
|
* the signatures we process (X509, RSA2048, SHA256)
|
|
*/
|
|
#define certentry_for_each_cert(c, cl) \
|
|
for (c = (EFI_SIGNATURE_DATA *)((UINT8 *) (cl) + sizeof(EFI_SIGNATURE_LIST) + (cl)->SignatureHeaderSize); \
|
|
(UINT8 *)c < ((UINT8 *)(cl)) + (cl)->SignatureListSize; \
|
|
c = (EFI_SIGNATURE_DATA *)((UINT8 *)c + (cl)->SignatureSize))
|
|
|
|
EFI_STATUS
|
|
CreatePkX509SignatureList (
|
|
IN UINT8 *X509Data,
|
|
IN UINTN X509DataSize,
|
|
IN EFI_GUID owner,
|
|
OUT EFI_SIGNATURE_LIST **PkCert
|
|
);
|
|
EFI_STATUS
|
|
CreateTimeBasedPayload (
|
|
IN OUT UINTN *DataSize,
|
|
IN OUT UINT8 **Data
|
|
);
|
|
EFI_STATUS
|
|
SetSecureVariable(CHAR16 *var, UINT8 *Data, UINTN len, EFI_GUID owner, UINT32 options, int createtimebased);
|
|
EFI_STATUS
|
|
get_variable(CHAR16 *var, UINT8 **data, UINTN *len, EFI_GUID owner);
|
|
EFI_STATUS
|
|
get_variable_attr(CHAR16 *var, UINT8 **data, UINTN *len, EFI_GUID owner,
|
|
UINT32 *attributes);
|
|
EFI_STATUS
|
|
find_in_esl(UINT8 *Data, UINTN DataSize, UINT8 *key, UINTN keylen);
|
|
EFI_STATUS
|
|
find_in_variable_esl(CHAR16* var, EFI_GUID owner, UINT8 *key, UINTN keylen);
|
|
|
|
#define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001
|
|
|
|
UINT64
|
|
GetOSIndications(void);
|
|
EFI_STATUS
|
|
SETOSIndicationsAndReboot(UINT64 indications);
|
|
int
|
|
variable_is_secureboot(void);
|
|
int
|
|
variable_is_setupmode(int default_return);
|
|
EFI_STATUS
|
|
variable_enroll_hash(CHAR16 *var, EFI_GUID owner,
|
|
UINT8 hash[SHA256_DIGEST_SIZE]);
|
|
EFI_STATUS
|
|
variable_create_esl(const uint8_t *cert, const size_t cert_len,
|
|
const EFI_GUID *type, const EFI_GUID *owner,
|
|
uint8_t **out, size_t *outlen);
|
|
EFI_STATUS
|
|
fill_esl(const uint8_t *data, const size_t data_len,
|
|
const EFI_GUID *type, const EFI_GUID *owner,
|
|
uint8_t *out, size_t *outlen);
|
|
|
|
#endif /* SHIM_VARIABLES_H */
|