TianoCore EDK2 master
|
#include "AuthServiceInternal.h"
#include <Protocol/VariablePolicy.h>
#include <Library/VariablePolicyLib.h>
Go to the source code of this file.
Data Structures | |
struct | EFI_HASH_INFO |
Macros | |
#define | SHA_DIGEST_SIZE_MAX SHA512_DIGEST_SIZE |
Typedefs | |
typedef UINTN(EFIAPI * | EFI_HASH_GET_CONTEXT_SIZE) (VOID) |
typedef BOOLEAN(EFIAPI * | EFI_HASH_INIT) (OUT VOID *HashContext) |
typedef BOOLEAN(EFIAPI * | EFI_HASH_UPDATE) (IN OUT VOID *HashContext, IN CONST VOID *Data, IN UINTN DataSize) |
typedef BOOLEAN(EFIAPI * | EFI_HASH_FINAL) (IN OUT VOID *HashContext, OUT UINT8 *HashValue) |
Functions | |
EFI_STATUS | AuthServiceInternalFindVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT VOID **Data, OUT UINTN *DataSize) |
EFI_STATUS | AuthServiceInternalUpdateVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes) |
EFI_STATUS | AuthServiceInternalUpdateVariableWithTimeStamp (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes, IN EFI_TIME *TimeStamp) |
BOOLEAN | NeedPhysicallyPresent (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid) |
BOOLEAN | InCustomMode (VOID) |
EFI_STATUS | UpdatePlatformMode (IN UINT32 Mode) |
EFI_STATUS | CheckSignatureListFormat (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize) |
EFI_STATUS | VendorKeyIsModified (VOID) |
EFI_STATUS | ProcessVarWithPk (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes OPTIONAL, IN BOOLEAN IsPk) |
EFI_STATUS | ProcessVarWithKek (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes OPTIONAL) |
BOOLEAN | IsDeleteAuthVariable (IN UINT32 OrgAttributes, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes) |
EFI_STATUS | ProcessVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes) |
EFI_STATUS | FilterSignatureList (IN VOID *Data, IN UINTN DataSize, IN OUT VOID *NewData, IN OUT UINTN *NewDataSize) |
BOOLEAN | AuthServiceInternalCompareTimeStamp (IN EFI_TIME *FirstTime, IN EFI_TIME *SecondTime) |
EFI_STATUS | CalculatePrivAuthVarSignChainSHADigest (IN UINT8 HashAlgId, IN UINT8 *SignerCert, IN UINTN SignerCertSize, IN UINT8 *TopLevelCert, IN UINTN TopLevelCertSize, OUT UINT8 *ShaDigest) |
EFI_STATUS | FindCertsFromDb (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT8 *Data, IN UINTN DataSize, OUT UINT32 *CertOffset OPTIONAL, OUT UINT32 *CertDataSize OPTIONAL, OUT UINT32 *CertNodeOffset OPTIONAL, OUT UINT32 *CertNodeSize OPTIONAL) |
EFI_STATUS | GetCertsFromDb (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, OUT UINT8 **CertData, OUT UINT32 *CertDataSize) |
EFI_STATUS | DeleteCertsFromDb (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes) |
EFI_STATUS | InsertCertsToDb (IN UINT8 HashAlgId, IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINT8 *SignerCert, IN UINTN SignerCertSize, IN UINT8 *TopLevelCert, IN UINTN TopLevelCertSize) |
EFI_STATUS | CleanCertsFromDb (VOID) |
UINT8 | FindHashAlgorithmIndex (IN UINT8 *SigData, IN UINT32 SigDataSize) |
EFI_STATUS | VerifyTimeBasedPayload (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes, IN AUTHVAR_TYPE AuthVarType, IN EFI_TIME *OrgTimeStamp, OUT UINT8 **VarPayloadPtr, OUT UINTN *VarPayloadSize) |
EFI_STATUS | VerifyTimeBasedPayloadAndUpdate (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes, IN AUTHVAR_TYPE AuthVarType, OUT BOOLEAN *VarDel) |
Variables | |
CONST UINT8 | mRsaE [] = { 0x01, 0x00, 0x01 } |
UINT8 | mSha256OidValue [] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01 } |
UINT8 | mSha384OidValue [] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02 } |
UINT8 | mSha512OidValue [] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03 } |
EFI_HASH_INFO | mHashInfo [] |
EFI_SIGNATURE_ITEM | mSupportSigItem [] |
Implement authentication services for the authenticated variables.
Caution: This module requires additional review when modified. This driver will have external input - variable data. It may be input in SMM mode. This external input must be validated carefully to avoid security issue like buffer overflow, integer overflow. Variable attribute should also be checked to avoid authentication bypass. The whole SMM authentication variable design relies on the integrity of flash part and SMM. which is assumed to be protected by platform. All variable code and metadata in flash/SMM Memory may not be modified without authorization. If platform fails to protect these resources, the authentication service provided in this driver will be broken, and the behavior is undefined.
ProcessVarWithPk(), ProcessVarWithKek() and ProcessVariable() are the function to do variable authentication.
VerifyTimeBasedPayloadAndUpdate() and VerifyCounterBasedPayload() are sub function to do verification. They will do basic validation for authentication data structure, then call crypto library to verify the signature.
Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AuthService.c.
#define SHA_DIGEST_SIZE_MAX SHA512_DIGEST_SIZE |
Definition at line 32 of file AuthService.c.
Completes computation of the Hash digest value.
This function completes hash computation and retrieves the digest value into the specified memory. After this function has been called, the Hash context cannot be used again. Hash context should be already correctly initialized by HashInit(), and should not be finalized by HashFinal(). Behavior with invalid Hash context is undefined.
If HashContext is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | HashContext | Pointer to the Hash context. |
[out] | HashValue | Pointer to a buffer that receives the Hash digest value. |
TRUE | Hash digest computation succeeded. |
FALSE | Hash digest computation failed. |
FALSE | This interface is not supported. |
Definition at line 120 of file AuthService.c.
typedef UINTN(EFIAPI * EFI_HASH_GET_CONTEXT_SIZE) (VOID) |
Retrieves the size, in bytes, of the context buffer required for hash operations.
If this interface is not supported, then return zero.
0 | This interface is not supported. |
Definition at line 44 of file AuthService.c.
typedef BOOLEAN(EFIAPI * EFI_HASH_INIT) (OUT VOID *HashContext) |
Initializes user-supplied memory pointed by Sha1Context as hash context for subsequent use.
If HashContext is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[out] | HashContext | Pointer to Hashcontext being initialized. |
TRUE | Hash context initialization succeeded. |
FALSE | Hash context initialization failed. |
FALSE | This interface is not supported. |
Definition at line 64 of file AuthService.c.
typedef BOOLEAN(EFIAPI * EFI_HASH_UPDATE) (IN OUT VOID *HashContext, IN CONST VOID *Data, IN UINTN DataSize) |
Digests the input data and updates Hash context.
This function performs Hash digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. Hash context should be already correctly initialized by HashInit(), and should not be finalized by HashFinal(). Behavior with invalid context is undefined.
If HashContext is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | HashContext | Pointer to the Hash context. |
[in] | Data | Pointer to the buffer containing the data to be hashed. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | SHA-1 data digest succeeded. |
FALSE | SHA-1 data digest failed. |
FALSE | This interface is not supported. |
Definition at line 90 of file AuthService.c.
Compare two EFI_TIME data.
FirstTime | A pointer to the first EFI_TIME data. |
SecondTime | A pointer to the second EFI_TIME data. |
TRUE | The FirstTime is not later than the SecondTime. |
FALSE | The FirstTime is later than the SecondTime. |
Definition at line 1185 of file AuthService.c.
EFI_STATUS AuthServiceInternalFindVariable | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
OUT VOID ** | Data, | ||
OUT UINTN * | DataSize | ||
) |
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.
[in] | VariableName | Name of the variable to be found. |
[in] | VendorGuid | Variable vendor GUID to be found. |
[out] | Data | Pointer to data address. |
[out] | DataSize | Pointer to data size. |
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 |
Definition at line 191 of file AuthService.c.
EFI_STATUS AuthServiceInternalUpdateVariable | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN VOID * | Data, | ||
IN UINTN | DataSize, | ||
IN UINT32 | Attributes | ||
) |
Update the variable region with Variable information.
[in] | VariableName | Name of variable. |
[in] | VendorGuid | Guid of variable. |
[in] | Data | Data pointer. |
[in] | DataSize | Size of Data. |
[in] | Attributes | Attribute value of the variable. |
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. |
Definition at line 228 of file AuthService.c.
EFI_STATUS AuthServiceInternalUpdateVariableWithTimeStamp | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN VOID * | Data, | ||
IN UINTN | DataSize, | ||
IN UINT32 | Attributes, | ||
IN EFI_TIME * | TimeStamp | ||
) |
Update the variable region with Variable information.
[in] | VariableName | Name of variable. |
[in] | VendorGuid | Guid of variable. |
[in] | Data | Data pointer. |
[in] | DataSize | Size of Data. |
[in] | Attributes | Attribute value of the variable. |
[in] | TimeStamp | Value of associated TimeStamp. |
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. |
Definition at line 267 of file AuthService.c.
EFI_STATUS CalculatePrivAuthVarSignChainSHADigest | ( | IN UINT8 | HashAlgId, |
IN UINT8 * | SignerCert, | ||
IN UINTN | SignerCertSize, | ||
IN UINT8 * | TopLevelCert, | ||
IN UINTN | TopLevelCertSize, | ||
OUT UINT8 * | ShaDigest | ||
) |
Calculate SHA digest of SignerCert CommonName + ToplevelCert tbsCertificate. SignerCert and ToplevelCert are inside the signer certificate chain.
[in] | HashAlgId | Hash algorithm index. |
[in] | SignerCert | A pointer to SignerCert data. |
[in] | SignerCertSize | Length of SignerCert data. |
[in] | TopLevelCert | A pointer to TopLevelCert data. |
[in] | TopLevelCertSize | Length of TopLevelCert data. |
[out] | ShaDigest | Sha digest calculated. |
Definition at line 1221 of file AuthService.c.
EFI_STATUS CheckSignatureListFormat | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN VOID * | Data, | ||
IN UINTN | DataSize | ||
) |
Check input data form to make sure it is a valid EFI_SIGNATURE_LIST for PK/KEK/db/dbx/dbt variable.
[in] | VariableName | Name of Variable to be check. |
[in] | VendorGuid | Variable vendor GUID. |
[in] | Data | Point to the variable data to be checked. |
[in] | DataSize | Size of Data. |
Definition at line 512 of file AuthService.c.
EFI_STATUS CleanCertsFromDb | ( | VOID | ) |
Clean up signer's certificates for common authenticated variable by corresponding VariableName and VendorGuid from "certdb". System may break down during Timebased Variable update & certdb update, make them inconsistent, this function is called in AuthVariable Init to ensure consistency.
EFI_NOT_FOUND | Fail to find variable "certdb". |
EFI_OUT_OF_RESOURCES | The operation is failed due to lack of resources. |
EFI_SUCCESS | The operation is completed successfully. |
Definition at line 1825 of file AuthService.c.
EFI_STATUS DeleteCertsFromDb | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN UINT32 | Attributes | ||
) |
Delete matching signer's certificates when deleting common authenticated variable by corresponding VariableName and VendorGuid from "certdb" or "certdbv" according to authenticated variable attributes.
[in] | VariableName | Name of authenticated Variable. |
[in] | VendorGuid | Vendor GUID of authenticated Variable. |
[in] | Attributes | Attributes of authenticated variable. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_NOT_FOUND | Fail to find "certdb"/"certdbv" or matching certs. |
EFI_OUT_OF_RESOURCES | The operation is failed due to lack of resources. |
EFI_SUCCESS | The operation is completed successfully. |
Definition at line 1518 of file AuthService.c.
EFI_STATUS FilterSignatureList | ( | IN VOID * | Data, |
IN UINTN | DataSize, | ||
IN OUT VOID * | NewData, | ||
IN OUT UINTN * | NewDataSize | ||
) |
Filter out the duplicated EFI_SIGNATURE_DATA from the new data by comparing to the original data.
[in] | Data | Pointer to original EFI_SIGNATURE_LIST. |
[in] | DataSize | Size of Data buffer. |
[in,out] | NewData | Pointer to new EFI_SIGNATURE_LIST. |
[in,out] | NewDataSize | Size of NewData buffer. |
Definition at line 1058 of file AuthService.c.
EFI_STATUS FindCertsFromDb | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN UINT8 * | Data, | ||
IN UINTN | DataSize, | ||
OUT UINT32 *CertOffset | OPTIONAL, | ||
OUT UINT32 *CertDataSize | OPTIONAL, | ||
OUT UINT32 *CertNodeOffset | OPTIONAL, | ||
OUT UINT32 *CertNodeSize | OPTIONAL | ||
) |
Find matching signer's certificates for common authenticated variable by corresponding VariableName and VendorGuid from "certdb" or "certdbv".
The data format of "certdb" or "certdbv":
UINT32 CertDbListSize; /// AUTH_CERT_DB_DATA Certs1[]; /// AUTH_CERT_DB_DATA Certs2[]; /// ... /// AUTH_CERT_DB_DATA Certsn[];
[in] | VariableName | Name of authenticated Variable. |
[in] | VendorGuid | Vendor GUID of authenticated Variable. |
[in] | Data | Pointer to variable "certdb" or "certdbv". |
[in] | DataSize | Size of variable "certdb" or "certdbv". |
[out] | CertOffset | Offset of matching CertData, from starting of Data. |
[out] | CertDataSize | Length of CertData in bytes. |
[out] | CertNodeOffset | Offset of matching AUTH_CERT_DB_DATA , from starting of Data. |
[out] | CertNodeSize | Length of AUTH_CERT_DB_DATA in bytes. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_NOT_FOUND | Fail to find matching certs. |
EFI_SUCCESS | Find matching certs and output parameters. |
Definition at line 1324 of file AuthService.c.
Find hash algorithm index.
[in] | SigData | Pointer to the PKCS#7 message. |
[in] | SigDataSize | Length of the PKCS#7 message. |
UINT8 | Hash Algorithm Index. |
Definition at line 1930 of file AuthService.c.
EFI_STATUS GetCertsFromDb | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN UINT32 | Attributes, | ||
OUT UINT8 ** | CertData, | ||
OUT UINT32 * | CertDataSize | ||
) |
Retrieve signer's certificates for common authenticated variable by corresponding VariableName and VendorGuid from "certdb" or "certdbv" according to authenticated variable attributes.
[in] | VariableName | Name of authenticated Variable. |
[in] | VendorGuid | Vendor GUID of authenticated Variable. |
[in] | Attributes | Attributes of authenticated variable. |
[out] | CertData | Pointer to signer's certificates. |
[out] | CertDataSize | Length of CertData in bytes. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_NOT_FOUND | Fail to find "certdb"/"certdbv" or matching certs. |
EFI_SUCCESS | Get signer's certificates successfully. |
Definition at line 1435 of file AuthService.c.
BOOLEAN InCustomMode | ( | VOID | ) |
Determine whether the platform is operating in Custom Secure Boot mode.
TRUE | The platform is operating in Custom mode. |
FALSE | The platform is operating in Standard mode. |
Definition at line 358 of file AuthService.c.
EFI_STATUS InsertCertsToDb | ( | IN UINT8 | HashAlgId, |
IN CHAR16 * | VariableName, | ||
IN EFI_GUID * | VendorGuid, | ||
IN UINT32 | Attributes, | ||
IN UINT8 * | SignerCert, | ||
IN UINTN | SignerCertSize, | ||
IN UINT8 * | TopLevelCert, | ||
IN UINTN | TopLevelCertSize | ||
) |
Insert signer's certificates for common authenticated variable with VariableName and VendorGuid in AUTH_CERT_DB_DATA to "certdb" or "certdbv" according to time based authenticated variable attributes. CertData is the SHA digest of SignerCert CommonName + TopLevelCert tbsCertificate.
[in] | HashAlgId | Hash algorithm index. |
[in] | VariableName | Name of authenticated Variable. |
[in] | VendorGuid | Vendor GUID of authenticated Variable. |
[in] | Attributes | Attributes of authenticated variable. |
[in] | SignerCert | Signer certificate data. |
[in] | SignerCertSize | Length of signer certificate. |
[in] | TopLevelCert | Top-level certificate data. |
[in] | TopLevelCertSize | Length of top-level certificate. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_ACCESS_DENIED | An AUTH_CERT_DB_DATA entry with same VariableName and VendorGuid already exists. |
EFI_OUT_OF_RESOURCES | The operation is failed due to lack of resources. |
EFI_SUCCESS | Insert an AUTH_CERT_DB_DATA entry to "certdb" or "certdbv" |
Definition at line 1659 of file AuthService.c.
BOOLEAN IsDeleteAuthVariable | ( | IN UINT32 | OrgAttributes, |
IN VOID * | Data, | ||
IN UINTN | DataSize, | ||
IN UINT32 | Attributes | ||
) |
Check if it is to delete auth variable.
[in] | OrgAttributes | Original attribute value of the variable. |
[in] | Data | Data pointer. |
[in] | DataSize | Size of Data. |
[in] | Attributes | Attribute value of the variable. |
TRUE | It is to delete auth variable. |
FALSE | It is not to delete auth variable. |
Definition at line 901 of file AuthService.c.
Determine whether this operation needs a physical present user.
[in] | VariableName | Name of the Variable. |
[in] | VendorGuid | GUID of the Variable. |
TRUE | This variable is protected, only a physical present user could set this variable. |
FALSE | This variable is not protected. |
Definition at line 333 of file AuthService.c.
EFI_STATUS ProcessVariable | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN VOID * | Data, | ||
IN UINTN | DataSize, | ||
IN UINT32 | Attributes | ||
) |
Process variable with EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set
Caution: This function may receive untrusted input. This function may be invoked in SMM mode, and datasize and data are external input. This function will do basic validation, before parse the data. This function will parse the authentication carefully to avoid security issues, like buffer overflow, integer overflow. This function will check attribute carefully to avoid authentication bypass.
[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. |
Definition at line 965 of file AuthService.c.
EFI_STATUS ProcessVarWithKek | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN VOID * | Data, | ||
IN UINTN | DataSize, | ||
IN UINT32 Attributes | OPTIONAL | ||
) |
Process variable with key exchange key for verification.
Caution: This function may receive untrusted input. This function may be invoked in SMM mode, and datasize and data are external input. This function will do basic validation, before parse the data. This function will parse the authentication carefully to avoid security issues, like buffer overflow, integer overflow. This function will check attribute carefully to avoid authentication bypass.
[in] | VariableName | Name of Variable to be found. |
[in] | VendorGuid | Variable vendor GUID. |
[in] | Data | Data pointer. |
[in] | DataSize | Size of Data found. If size is less than the data, this value contains the required size. |
[in] | Attributes | Attribute value of the variable. |
Definition at line 820 of file AuthService.c.
EFI_STATUS ProcessVarWithPk | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN VOID * | Data, | ||
IN UINTN | DataSize, | ||
IN UINT32 Attributes | OPTIONAL, | ||
IN BOOLEAN | IsPk | ||
) |
Process variable with platform key for verification.
Caution: This function may receive untrusted input. This function may be invoked in SMM mode, and datasize and data are external input. This function will do basic validation, before parse the data. This function will parse the authentication carefully to avoid security issues, like buffer overflow, integer overflow. This function will check attribute carefully to avoid authentication bypass.
[in] | VariableName | Name of Variable to be found. |
[in] | VendorGuid | Variable vendor GUID. |
[in] | Data | Data pointer. |
[in] | DataSize | Size of Data found. If size is less than the data, this value contains the required size. |
[in] | Attributes | Attribute value of the variable |
[in] | IsPk | Indicate whether it is to process pk. |
Definition at line 691 of file AuthService.c.
EFI_STATUS UpdatePlatformMode | ( | IN UINT32 | Mode | ) |
Update platform mode.
[in] | Mode | SETUP_MODE or USER_MODE. |
Definition at line 384 of file AuthService.c.
EFI_STATUS VendorKeyIsModified | ( | VOID | ) |
Update "VendorKeys" variable to record the out of band secure boot key modification.
Definition at line 634 of file AuthService.c.
EFI_STATUS VerifyTimeBasedPayload | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN VOID * | Data, | ||
IN UINTN | DataSize, | ||
IN UINT32 | Attributes, | ||
IN AUTHVAR_TYPE | AuthVarType, | ||
IN EFI_TIME * | OrgTimeStamp, | ||
OUT UINT8 ** | VarPayloadPtr, | ||
OUT UINTN * | VarPayloadSize | ||
) |
Process variable with EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set
Caution: This function may receive untrusted input. This function may be invoked in SMM mode, and datasize and data are external input. This function will do basic validation, before parse the data. This function will parse the authentication carefully to avoid security issues, like buffer overflow, integer overflow.
[in] | VariableName | Name of Variable to be found. |
[in] | VendorGuid | Variable vendor GUID. |
[in] | Data | Data pointer. |
[in] | DataSize | Size of Data found. If size is less than the data, this value contains the required size. |
[in] | Attributes | Attribute value of the variable. |
[in] | AuthVarType | Verify against PK, KEK database, private database or certificate in data payload. |
[in] | OrgTimeStamp | Pointer to original time stamp, original variable is not found if NULL. |
[out] | VarPayloadPtr | Pointer to variable payload address. |
[out] | VarPayloadSize | Pointer to variable payload size. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_SECURITY_VIOLATION | The variable does NOT pass the validation check carried out by the firmware. |
EFI_OUT_OF_RESOURCES | Failed to process variable due to lack of resources. |
EFI_SUCCESS | Variable pass validation successfully. |
Definition at line 1982 of file AuthService.c.
EFI_STATUS VerifyTimeBasedPayloadAndUpdate | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN VOID * | Data, | ||
IN UINTN | DataSize, | ||
IN UINT32 | Attributes, | ||
IN AUTHVAR_TYPE | AuthVarType, | ||
OUT BOOLEAN * | VarDel | ||
) |
Process variable with EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set
Caution: This function may receive untrusted input. This function may be invoked in SMM mode, and datasize and data are external input. This function will do basic validation, before parse the data. This function will parse the authentication carefully to avoid security issues, like buffer overflow, integer overflow.
[in] | VariableName | Name of Variable to be found. |
[in] | VendorGuid | Variable vendor GUID. |
[in] | Data | Data pointer. |
[in] | DataSize | Size of Data found. If size is less than the data, this value contains the required size. |
[in] | Attributes | Attribute value of the variable. |
[in] | AuthVarType | Verify against PK, KEK database, private database or certificate in data payload. |
[out] | VarDel | Delete the variable or not. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_SECURITY_VIOLATION | The variable does NOT pass the validation check carried out by the firmware. |
EFI_OUT_OF_RESOURCES | Failed to process variable due to lack of resources. |
EFI_SUCCESS | Variable pass validation successfully. |
Definition at line 2462 of file AuthService.c.
EFI_HASH_INFO mHashInfo[] |
Definition at line 146 of file AuthService.c.
CONST UINT8 mRsaE[] = { 0x01, 0x00, 0x01 } |
Definition at line 140 of file AuthService.c.
UINT8 mSha256OidValue[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01 } |
Definition at line 142 of file AuthService.c.
UINT8 mSha384OidValue[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02 } |
Definition at line 143 of file AuthService.c.
UINT8 mSha512OidValue[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03 } |
Definition at line 144 of file AuthService.c.
EFI_SIGNATURE_ITEM mSupportSigItem[] |
Definition at line 156 of file AuthService.c.