OpenCore
1.0.4
OpenCore Bootloader
|
#include <PiDxe.h>
#include <Guid/ImageAuthentication.h>
#include <IndustryStandard/UefiTcgPlatform.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseLib.h>
#include <Library/TpmMeasurementLib.h>
#include "PrivilegePolymorphic.h"
Go to the source code of this file.
Data Structures | |
struct | VARIABLE_TYPE |
Functions | |
BOOLEAN | IsSecureBootPolicyVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid) |
EFI_STATUS EFIAPI | MeasureVariable (IN CHAR16 *VarName, IN EFI_GUID *VendorGuid, IN VOID *VarData, IN UINTN VarSize) |
EFI_STATUS | InternalGetVariable (IN CONST CHAR16 *Name, IN CONST EFI_GUID *Guid, OUT VOID **Value, OUT UINTN *Size) |
VOID EFIAPI | SecureBootHook (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid) |
VOID EFIAPI | RecordSecureBootPolicyVarData (VOID) |
Variables | |
VARIABLE_TYPE | mVariableType [] |
UINT8 * | mSecureBootVarData = NULL |
UINTN | mSecureBootVarDataSize = 0 |
Measure TCG required variable.
Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Measurement.c.
EFI_STATUS InternalGetVariable | ( | IN CONST CHAR16 * | Name, |
IN CONST EFI_GUID * | Guid, | ||
OUT VOID ** | Value, | ||
OUT UINTN * | Size ) |
Returns the status whether get the variable success. The function retrieves variable through the UEFI Runtime Service GetVariable(). The returned buffer is allocated using AllocatePool(). The caller is responsible for freeing this buffer with FreePool().
This API is only invoked in boot time. It may NOT be invoked at runtime.
[in] | Name | The pointer to a Null-terminated Unicode string. |
[in] | Guid | The pointer to an EFI_GUID structure |
[out] | Value | The buffer point saved the variable info. |
[out] | Size | The buffer size of the variable. |
Definition at line 160 of file Measurement.c.
BOOLEAN IsSecureBootPolicyVariable | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid ) |
This function will return if this variable is SecureBootPolicy Variable.
[in] | VariableName | A Null-terminated string that is the name of the vendor's variable. |
[in] | VendorGuid | A unique identifier for the vendor. |
TRUE | This is SecureBootPolicy Variable |
FALSE | This is not SecureBootPolicy Variable |
Definition at line 54 of file Measurement.c.
EFI_STATUS EFIAPI MeasureVariable | ( | IN CHAR16 * | VarName, |
IN EFI_GUID * | VendorGuid, | ||
IN VOID * | VarData, | ||
IN UINTN | VarSize ) |
Measure and log an EFI variable, and extend the measurement result into a specific PCR.
[in] | VarName | A Null-terminated string that is the name of the vendor's variable. |
[in] | VendorGuid | A unique identifier for the vendor. |
[in] | VarData | The content of the variable data. |
[in] | VarSize | The size of the variable data. |
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
Definition at line 87 of file Measurement.c.
VOID EFIAPI RecordSecureBootPolicyVarData | ( | VOID | ) |
Some Secure Boot Policy Variable may update following other variable changes(SecureBoot follows PK change, etc). Record their initial State when variable write service is ready.
Definition at line 321 of file Measurement.c.
VOID EFIAPI SecureBootHook | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid ) |
SecureBoot Hook for SetVariable.
[in] | VariableName | Name of Variable to be found. |
[in] | VendorGuid | Variable vendor GUID. |
Definition at line 218 of file Measurement.c.
UINT8* mSecureBootVarData = NULL |
Definition at line 41 of file Measurement.c.
UINTN mSecureBootVarDataSize = 0 |
Definition at line 42 of file Measurement.c.
VARIABLE_TYPE mVariableType[] |
Definition at line 28 of file Measurement.c.