MdeModulePkg/Include/Library/AuthVariableLib.h File Reference


Data Structures

struct  AUTH_VARIABLE_INFO
struct  AUTH_VAR_LIB_CONTEXT_IN
struct  AUTH_VAR_LIB_CONTEXT_OUT

Defines

#define AUTHINFO_SIZE
#define AUTHINFO2_SIZE(VarAuth2)
#define OFFSET_OF_AUTHINFO2_CERT_DATA
#define AUTH_VAR_LIB_CONTEXT_IN_STRUCT_VERSION   0x01
#define AUTH_VAR_LIB_CONTEXT_OUT_STRUCT_VERSION   0x01

Typedefs

typedef IN EFI_GUID * VendorGuid
typedef IN EFI_GUID OUT
AUTH_VARIABLE_INFO
AuthVariableInfo
typedef OUT VOID ** ScratchBuffer
typedef typedef BOOLEAN (EFIAPI *AUTH_VAR_LIB_AT_RUNTIME)(VOID)

Functions

typedef EFI_STATUS (EFIAPI *AUTH_VAR_LIB_FIND_VARIABLE)(IN CHAR16 *VariableName
typedef BOOLEAN (EFIAPI *AUTH_VAR_LIB_CHECK_REMAINING_SPACE)(IN UINT32 Attributes
EFI_STATUS EFIAPI AuthVariableLibInitialize (IN AUTH_VAR_LIB_CONTEXT_IN *AuthVarLibContextIn, OUT AUTH_VAR_LIB_CONTEXT_OUT *AuthVarLibContextOut)
EFI_STATUS EFIAPI AuthVariableLibProcessVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes)

Detailed Description

Provides services to initialize and process authenticated variables.

Copyright (c) 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Define Documentation

#define AUTH_VAR_LIB_CONTEXT_IN_STRUCT_VERSION   0x01

#define AUTH_VAR_LIB_CONTEXT_OUT_STRUCT_VERSION   0x01

#define AUTHINFO2_SIZE ( VarAuth2   ) 

Value:

((OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, AuthInfo)) + \
                                  (UINTN) ((EFI_VARIABLE_AUTHENTICATION_2 *) (VarAuth2))->AuthInfo.Hdr.dwLength)

#define AUTHINFO_SIZE

Value:

((OFFSET_OF (EFI_VARIABLE_AUTHENTICATION, AuthInfo)) + \
                       (OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData)) + \
                       sizeof (EFI_CERT_BLOCK_RSA_2048_SHA256))
Size of AuthInfo prior to the data payload.

#define OFFSET_OF_AUTHINFO2_CERT_DATA

Value:

((OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, AuthInfo)) + \
                                       (OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData)))


Typedef Documentation

typedef IN EFI_GUID OUT AUTH_VARIABLE_INFO * AuthVariableInfo

typedef BOOLEAN ( EFIAPI *  AUTH_VAR_LIB_AT_RUNTIME  ) 

Return TRUE if at OS runtime.

Return values:
TRUE If at OS runtime.
FALSE If at boot time.
Check whether required reset when exit the browser

Return values:
TRUE Browser required to reset after exit.
FALSE Browser not need to reset after exit.

typedef OUT VOID** ScratchBuffer

typedef IN EFI_GUID * VendorGuid


Function Documentation

EFI_STATUS EFIAPI AuthVariableLibInitialize ( IN AUTH_VAR_LIB_CONTEXT_IN AuthVarLibContextIn,
OUT AUTH_VAR_LIB_CONTEXT_OUT AuthVarLibContextOut 
)

Initialization for authenticated varibale services. If this initialization returns error status, other APIs will not work and expect to be not called then.

Parameters:
[in] AuthVarLibContextIn Pointer to input auth variable lib context.
[out] AuthVarLibContextOut Pointer to output auth variable lib context.
Return values:
EFI_SUCCESS Function successfully executed.
EFI_INVALID_PARAMETER If AuthVarLibContextIn == NULL or AuthVarLibContextOut == NULL.
EFI_OUT_OF_RESOURCES Fail to allocate enough resource.
EFI_UNSUPPORTED Unsupported to process authenticated variable.

EFI_STATUS EFIAPI AuthVariableLibProcessVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID *  VendorGuid,
IN VOID *  Data,
IN UINTN  DataSize,
IN UINT32  Attributes 
)

Process variable with EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS/EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set.

Parameters:
[in] VariableName Name of the variable.
[in] VendorGuid Variable vendor GUID.
[in] Data Data pointer.
[in] DataSize Size of Data.
[in] Attributes Attribute value of the variable.
Return values:
EFI_SUCCESS The firmware has successfully stored the variable and its data as defined by the Attributes.
EFI_INVALID_PARAMETER Invalid parameter.
EFI_WRITE_PROTECTED Variable is write-protected.
EFI_OUT_OF_RESOURCES There is not enough resource.
EFI_SECURITY_VIOLATION The variable is with EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS set, but the AuthInfo does NOT pass the validation check carried out by the firmware.
EFI_UNSUPPORTED Unsupported to process authenticated variable.

typedef BOOLEAN ( EFIAPI *  AUTH_VAR_LIB_CHECK_REMAINING_SPACE  ) 

This function is to check if the remaining variable space is enough to set all Variables from argument list successfully. The purpose of the check is to keep the consistency of the Variables to be in variable storage.

Note: Variables are assumed to be in same storage. The set sequence of Variables will be same with the sequence of VariableEntry from argument list, so follow the argument sequence to check the Variables.

Parameters:
[in] Attributes Variable attributes for Variable entries.
... The variable argument list with type VARIABLE_ENTRY_CONSISTENCY *. A NULL terminates the list. The VariableSize of VARIABLE_ENTRY_CONSISTENCY is the variable data size as input. It will be changed to variable total size as output.
Return values:
TRUE Have enough variable space to set the Variables successfully.
FALSE No enough variable space to set the Variables successfully.

typedef EFI_STATUS ( EFIAPI *  AUTH_VAR_LIB_GET_SCRATCH_BUFFER  ) 

Finds variable in storage blocks of volatile and non-volatile storage areas.

This code finds variable in storage blocks of volatile and non-volatile storage areas. If VariableName is an empty string, then we just return the first qualified variable without comparing VariableName and VendorGuid.

Parameters:
[in] VariableName Name of the variable to be found.
[in] VendorGuid Variable vendor GUID to be found.
[out] AuthVariableInfo Pointer to AUTH_VARIABLE_INFO structure for output of the variable found.
Return values:
EFI_INVALID_PARAMETER If VariableName is not an empty string, while VendorGuid is NULL.
EFI_SUCCESS Variable successfully found.
EFI_NOT_FOUND Variable not found
Finds next variable in storage blocks of volatile and non-volatile storage areas.

This code finds next variable in storage blocks of volatile and non-volatile storage areas. If VariableName is an empty string, then we just return the first qualified variable without comparing VariableName and VendorGuid.

Parameters:
[in] VariableName Name of the variable to be found.
[in] VendorGuid Variable vendor GUID to be found.
[out] AuthVariableInfo Pointer to AUTH_VARIABLE_INFO structure for output of the next variable.
Return values:
EFI_INVALID_PARAMETER If VariableName is not an empty string, while VendorGuid is NULL.
EFI_SUCCESS Variable successfully found.
EFI_NOT_FOUND Variable not found
Update the variable region with Variable information.

Parameters:
[in] AuthVariableInfo Pointer AUTH_VARIABLE_INFO structure for input of the variable.
Return values:
EFI_SUCCESS The update operation is success.
EFI_INVALID_PARAMETER Invalid parameter.
EFI_WRITE_PROTECTED Variable is write-protected.
EFI_OUT_OF_RESOURCES There is not enough resource.
Get scratch buffer.

Parameters:
[in,out] ScratchBufferSize Scratch buffer size. If input size is greater than the maximum supported buffer size, this value contains the maximum supported buffer size as output.
[out] ScratchBuffer Pointer to scratch buffer address.
Return values:
EFI_SUCCESS Get scratch buffer successfully.
EFI_UNSUPPORTED If input size is greater than the maximum supported buffer size.


Generated on Thu Sep 24 23:30:14 2015 for MdeModulePkg[ALL] by  doxygen 1.5.7.1