|
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) |
|
EFI_STATUS | DeleteCertsFromDb (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes) |
|
EFI_STATUS | CleanCertsFromDb (VOID) |
|
EFI_STATUS | FilterSignatureList (IN VOID *Data, IN UINTN DataSize, IN OUT VOID *NewData, IN OUT UINTN *NewDataSize) |
|
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) |
|
EFI_STATUS | ProcessVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes) |
|
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) |
|
The internal header file includes the common header files, defines internal structure and functions used by AuthService module.
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.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AuthServiceInternal.h.
#define EFI_CERT_DB_NAME L"certdb" |
"certdb" variable stores the signer's certificates for non PK/KEK/DB/DBX variables with EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS|EFI_VARIABLE_NON_VOLATILE set. "certdbv" variable stores the signer's certificates for non PK/KEK/DB/DBX variables with EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set
GUID: gEfiCertDbGuid
We need maintain atomicity.
Format: +-------------------------—+ | UINT32 | <– CertDbListSize, including this UINT32 +-------------------------—+ | AUTH_CERT_DB_DATA | <– First CERT +-------------------------—+ | ........ | +-------------------------—+ | AUTH_CERT_DB_DATA | <– Last CERT +-------------------------—+
Definition at line 76 of file AuthServiceInternal.h.
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
- Return values
-
EFI_NOT_FOUND | Fail to find matching certs. |
EFI_SUCCESS | Find matching certs and output parameters. |
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.
- Return values
-
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.
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.
- 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. |
- Returns
- EFI_INVALID_PARAMETER Invalid parameter.
-
EFI_WRITE_PROTECTED Variable is write-protected and needs authentication with EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set.
-
EFI_OUT_OF_RESOURCES The Database to save the public key is full.
-
EFI_SECURITY_VIOLATION The variable is with EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set, but the AuthInfo does NOT pass the validation check carried out by the firmware.
-
EFI_SUCCESS Variable is not write-protected or pass validation successfully.
Definition at line 965 of file AuthService.c.
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.
- Parameters
-
[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. |
- Returns
- EFI_INVALID_PARAMETER Invalid parameter.
-
EFI_SECURITY_VIOLATION The variable does NOT pass the validation check carried out by the firmware.
-
EFI_SUCCESS Variable pass validation successfully.
Definition at line 820 of file AuthService.c.
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.
- Parameters
-
[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. |
- Returns
- EFI_INVALID_PARAMETER Invalid parameter.
-
EFI_SECURITY_VIOLATION The variable does NOT pass the validation. check carried out by the firmware.
-
EFI_SUCCESS Variable passed validation successfully.
Definition at line 691 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.
- Parameters
-
[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. |
- Return values
-
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.