TianoCore EDK2 master
Loading...
Searching...
No Matches
AuthVariableLib.h
Go to the documentation of this file.
1
9#ifndef _AUTH_VARIABLE_LIB_H_
10#define _AUTH_VARIABLE_LIB_H_
11
12#include <Protocol/VarCheck.h>
13
17#define AUTHINFO_SIZE ((OFFSET_OF (EFI_VARIABLE_AUTHENTICATION, AuthInfo)) +\
18 (OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData)) + \
19 sizeof (EFI_CERT_BLOCK_RSA_2048_SHA256))
20
21#define AUTHINFO2_SIZE(VarAuth2) ((OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, AuthInfo)) +\
22 (UINTN) ((EFI_VARIABLE_AUTHENTICATION_2 *) (VarAuth2))->AuthInfo.Hdr.dwLength)
23
24#define OFFSET_OF_AUTHINFO2_CERT_DATA ((OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, AuthInfo)) +\
25 (OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData)))
26
27typedef struct {
28 CHAR16 *VariableName;
29 EFI_GUID *VendorGuid;
30 UINT32 Attributes;
31 UINTN DataSize;
32 VOID *Data;
33 UINT32 PubKeyIndex;
34 UINT64 MonotonicCount;
35 EFI_TIME *TimeStamp;
37
56typedef
59 IN CHAR16 *VariableName,
60 IN EFI_GUID *VendorGuid,
61 OUT AUTH_VARIABLE_INFO *AuthVariableInfo
62 );
63
82typedef
85 IN CHAR16 *VariableName,
86 IN EFI_GUID *VendorGuid,
87 OUT AUTH_VARIABLE_INFO *AuthVariableInfo
88 );
89
102typedef
105 IN AUTH_VARIABLE_INFO *AuthVariableInfo
106 );
107
120typedef
123 IN OUT UINTN *ScratchBufferSize,
124 OUT VOID **ScratchBuffer
125 );
126
146typedef
147BOOLEAN
149 IN UINT32 Attributes,
150 ...
151 );
152
160typedef
161BOOLEAN
163 VOID
164 );
165
166#define AUTH_VAR_LIB_CONTEXT_IN_STRUCT_VERSION 0x01
167
168typedef struct {
169 UINTN StructVersion;
170 UINTN StructSize;
171 //
172 // Reflect the overhead associated with the saving
173 // of a single EFI authenticated variable with the exception
174 // of the overhead associated with the length
175 // of the string name of the EFI variable.
176 //
177 UINTN MaxAuthVariableSize;
179 AUTH_VAR_LIB_FIND_NEXT_VARIABLE FindNextVariable;
181 AUTH_VAR_LIB_GET_SCRATCH_BUFFER GetScratchBuffer;
185
186#define AUTH_VAR_LIB_CONTEXT_OUT_STRUCT_VERSION 0x01
187
188typedef struct {
189 UINTN StructVersion;
190 UINTN StructSize;
191 //
192 // Caller needs to set variable property for the variables.
193 //
194 VARIABLE_ENTRY_PROPERTY *AuthVarEntry;
195 UINTN AuthVarEntryCount;
196 //
197 // Caller needs to ConvertPointer() for the pointers.
198 //
199 VOID ***AddressPointer;
200 UINTN AddressPointerCount;
202
218EFIAPI
220 IN AUTH_VAR_LIB_CONTEXT_IN *AuthVarLibContextIn,
221 OUT AUTH_VAR_LIB_CONTEXT_OUT *AuthVarLibContextOut
222 );
223
245EFIAPI
247 IN CHAR16 *VariableName,
248 IN EFI_GUID *VendorGuid,
249 IN VOID *Data,
250 IN UINTN DataSize,
251 IN UINT32 Attributes
252 );
253
254#endif
UINT64 UINTN
EFI_STATUS(EFIAPI * AUTH_VAR_LIB_FIND_VARIABLE)(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT AUTH_VARIABLE_INFO *AuthVariableInfo)
EFI_STATUS EFIAPI AuthVariableLibInitialize(IN AUTH_VAR_LIB_CONTEXT_IN *AuthVarLibContextIn, OUT AUTH_VAR_LIB_CONTEXT_OUT *AuthVarLibContextOut)
EFI_STATUS(EFIAPI * AUTH_VAR_LIB_FIND_NEXT_VARIABLE)(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT AUTH_VARIABLE_INFO *AuthVariableInfo)
EFI_STATUS(EFIAPI * AUTH_VAR_LIB_UPDATE_VARIABLE)(IN AUTH_VARIABLE_INFO *AuthVariableInfo)
BOOLEAN(EFIAPI * AUTH_VAR_LIB_CHECK_REMAINING_SPACE)(IN UINT32 Attributes,...)
EFI_STATUS(EFIAPI * AUTH_VAR_LIB_GET_SCRATCH_BUFFER)(IN OUT UINTN *ScratchBufferSize, OUT VOID **ScratchBuffer)
EFI_STATUS EFIAPI AuthVariableLibProcessVariable(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes)
BOOLEAN(EFIAPI * AUTH_VAR_LIB_AT_RUNTIME)(VOID)
BOOLEAN AtRuntime(VOID)
Definition: VariableDxe.c:63
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_STATUS FindVariable(IN CONST CHAR16 *VariableName, IN CONST EFI_GUID *VendorGuid, OUT VARIABLE_POINTER_TRACK *PtrTrack, OUT VARIABLE_STORE_INFO *StoreInfo)
Definition: Variable.c:992
EFI_STATUS UpdateVariable(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes OPTIONAL, IN UINT32 KeyIndex OPTIONAL, IN UINT64 MonotonicCount OPTIONAL, IN OUT VARIABLE_POINTER_TRACK *CacheVariable, IN EFI_TIME *TimeStamp OPTIONAL)
Definition: Variable.c:1678
BOOLEAN EFIAPI CheckRemainingSpaceForConsistency(IN UINT32 Attributes,...)
Definition: Variable.c:1377
Definition: Base.h:213