10#ifndef __SECUREBOOT_CONFIG_IMPL_H__
11#define __SECUREBOOT_CONFIG_IMPL_H__
51extern UINT8 SecureBootConfigBin[];
52extern UINT8 SecureBootConfigDxeStrings[];
57extern VOID *mStartOpCodeHandle;
58extern VOID *mEndOpCodeHandle;
63#define TWO_BYTE_ENCODE 0x82
64#define BUFFER_MAX_SIZE 100
69#define SHA256_DIGEST_SIZE 32
73#define SHA384_DIGEST_SIZE 48
77#define SHA512_DIGEST_SIZE 64
82#define MAX_DIGEST_SIZE SHA512_DIGEST_SIZE
84#define WIN_CERT_UEFI_RSA2048_SIZE 256
85#define WIN_CERT_UEFI_RSA3072_SIZE 384
86#define WIN_CERT_UEFI_RSA4096_SIZE 512
91#define HASHALG_SHA224 0x00000000
92#define HASHALG_SHA256 0x00000001
93#define HASHALG_SHA384 0x00000002
94#define HASHALG_SHA512 0x00000003
95#define HASHALG_RAW 0x00000004
96#define HASHALG_MAX 0x00000004
101#define CER_PUBKEY_MIN_SIZE 256
106#define KEY_TYPE_RSASSA 0
137#define SECUREBOOT_FREE_NON_NULL(Pointer) \
139 if ((Pointer) != NULL) { \
140 FreePool((Pointer)); \
145#define SECUREBOOT_FREE_NON_OPCODE(Handle) \
147 if ((Handle) != NULL) { \
148 HiiFreeOpCodeHandle((Handle)); \
152#define SIGNATURE_DATA_COUNTS(List) \
153 (((List)->SignatureListSize - sizeof(EFI_SIGNATURE_LIST) - (List)->SignatureHeaderSize) / (List)->SignatureSize)
181} CURRENT_VARIABLE_NAME;
184 Delete_Signature_List_All,
185 Delete_Signature_List_One,
186 Delete_Signature_Data
187} SIGNATURE_DELETE_TYPE;
200 CURRENT_VARIABLE_NAME VariableName;
209#define SECUREBOOT_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('S', 'E', 'C', 'B')
210#define SECUREBOOT_CONFIG_PRIVATE_FROM_THIS(a) CR (a, SECUREBOOT_CONFIG_PRIVATE_DATA, ConfigAccess, SECUREBOOT_CONFIG_PRIVATE_DATA_SIGNATURE)
217 UINT32 KeyLengthInBits;
219 UINT32 CipherBlockSize;
253 IN OUT VOID *HashContext
274 IN OUT VOID *HashContext,
297 IN OUT VOID *HashContext,
377 OUT EFI_STRING *Progress,
378 OUT EFI_STRING *Results
403 IN CONST EFI_STRING Configuration,
404 OUT EFI_STRING *Progress
433 IN EFI_BROWSER_ACTION Action,
434 IN EFI_QUESTION_ID QuestionId,
437 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
486 IN OUT VOID **BufferPtr,
521 OUT UINT8 *OctetString,
EFI_STATUS EFIAPI HashUpdate(IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen)
BOOLEAN EFIAPI UpdatePKFromFile(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
EFI_STATUS EFIAPI Int2OctStr(IN CONST UINTN *Integer, IN UINTN IntSizeInWords, OUT UINT8 *OctetString, IN UINTN OSSizeInBytes)
BOOLEAN EFIAPI UpdateDBTFromFile(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
UINTN GuidToString(IN EFI_GUID *Guid, IN CHAR16 *Buffer, IN UINTN BufferSize)
EFI_STATUS EFIAPI SecureBootExtractConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
EFI_STATUS ReadFileContent(IN EFI_FILE_HANDLE FileHandle, IN OUT VOID **BufferPtr, OUT UINTN *FileSize, IN UINTN AdditionAllocateSize)
EFI_STATUS EFIAPI SecureBootRouteConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
VOID CleanUpPage(IN UINT16 LabelId, IN SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData)
BOOLEAN(EFIAPI * HASH_UPDATE)(IN OUT VOID *HashContext, IN CONST VOID *Data, IN UINTN DataLength)
BOOLEAN EFIAPI UpdateDBXFromFile(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
VOID CloseFile(IN EFI_FILE_HANDLE FileHandle)
EFI_STATUS(EFIAPI * HASH_GET_CONTEXT_SIZE)(VOID)
BOOLEAN EFIAPI UpdateKEKFromFile(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
EFI_STATUS InstallSecureBootConfigForm(IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData)
CHAR16 *EFIAPI DevicePathToStr(IN EFI_DEVICE_PATH_PROTOCOL *DevPath)
BOOLEAN(EFIAPI * HASH_INIT)(IN OUT VOID *HashContext)
EFI_STATUS EFIAPI SecureBootCallback(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
BOOLEAN EFIAPI UpdateDBFromFile(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
VOID UninstallSecureBootConfigForm(IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData)
BOOLEAN(EFIAPI * HASH_FINAL)(IN OUT VOID *HashContext, OUT UINT8 *HashValue)