]>
git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Include/Library/SecureBootVariableLib.h
9f2d41220b709be624373bb77d8afb096b175493
2 Provides a helper functions for creating variable authenticated
3 payloads, signature lists related to secure boot keys.
5 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
6 (C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
7 Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
8 Copyright (c) 2021, Semihalf All rights reserved.<BR>
9 Copyright (c) Microsoft Corporation.
10 SPDX-License-Identifier: BSD-2-Clause-Patent
14 #ifndef SECURE_BOOT_VARIABLE_LIB_H_
15 #define SECURE_BOOT_VARIABLE_LIB_H_
18 Set the platform secure boot mode into "Custom" or "Standard" mode.
20 @param[in] SecureBootMode New secure boot mode: STANDARD_SECURE_BOOT_MODE or
21 CUSTOM_SECURE_BOOT_MODE.
23 @return EFI_SUCCESS The platform has switched to the special mode successfully.
24 @return other Fail to operate the secure boot mode.
30 IN UINT8 SecureBootMode
34 Fetches the value of SetupMode variable.
36 @param[out] SetupMode Pointer to UINT8 for SetupMode output
38 @retval other Error codes from GetVariable.
47 Create a EFI Signature List with data fetched from section specified as a argument.
48 Found keys are verified using RsaGetPublicKeyFromX509().
50 @param[in] KeyFileGuid A pointer to to the FFS filename GUID
51 @param[out] SigListsSize A pointer to size of signature list
52 @param[out] SigListsOut a pointer to a callee-allocated buffer with signature lists
54 @retval EFI_SUCCESS Create time based payload successfully.
55 @retval EFI_NOT_FOUND Section with key has not been found.
56 @retval EFI_INVALID_PARAMETER Embedded key has a wrong format.
57 @retval Others Unexpected error happens.
62 IN EFI_GUID
*KeyFileGuid
,
63 OUT UINTN
*SigListsSize
,
64 OUT EFI_SIGNATURE_LIST
**SigListOut
68 Create a time based data payload by concatenating the EFI_VARIABLE_AUTHENTICATION_2
69 descriptor with the input data. NO authentication is required in this function.
71 @param[in, out] DataSize On input, the size of Data buffer in bytes.
72 On output, the size of data returned in Data
74 @param[in, out] Data On input, Pointer to data buffer to be wrapped or
75 pointer to NULL to wrap an empty payload.
76 On output, Pointer to the new payload date buffer allocated from pool,
77 it's caller's responsibility to free the memory when finish using it.
78 @param[in] Time Pointer to time information to created time based payload.
80 @retval EFI_SUCCESS Create time based payload successfully.
81 @retval EFI_OUT_OF_RESOURCES There are not enough memory resources to create time based payload.
82 @retval EFI_INVALID_PARAMETER The parameter is invalid.
83 @retval Others Unexpected error happens.
88 CreateTimeBasedPayload (
89 IN OUT UINTN
*DataSize
,
95 Clears the content of the 'db' variable.
97 @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
98 while VendorGuid is NULL.
99 @retval other Errors from GetVariable2(), GetTime() and SetVariable()
108 Clears the content of the 'dbx' variable.
110 @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
111 while VendorGuid is NULL.
112 @retval other Errors from GetVariable2(), GetTime() and SetVariable()
121 Clears the content of the 'dbt' variable.
123 @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
124 while VendorGuid is NULL.
125 @retval other Errors from GetVariable2(), GetTime() and SetVariable()
134 Clears the content of the 'KEK' variable.
136 @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
137 while VendorGuid is NULL.
138 @retval other Errors from GetVariable2(), GetTime() and SetVariable()
147 Clears the content of the 'PK' variable.
149 @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
150 while VendorGuid is NULL.
151 @retval other Errors from GetVariable2(), GetTime() and SetVariable()