2 This driver init default Secure Boot variables
4 Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
5 Copyright (c) 2021, Semihalf All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include <Guid/AuthenticatedVariableFormat.h>
10 #include <Guid/ImageAuthentication.h>
11 #include <Library/BaseLib.h>
12 #include <Library/BaseMemoryLib.h>
13 #include <Library/DebugLib.h>
14 #include <Library/MemoryAllocationLib.h>
15 #include <Library/UefiBootServicesTableLib.h>
16 #include <Library/UefiRuntimeServicesTableLib.h>
17 #include <Library/SecureBootVariableLib.h>
18 #include <Library/SecureBootVariableProvisionLib.h>
21 The entry point for SecureBootDefaultKeys driver.
23 @param[in] ImageHandle The image handle of the driver.
24 @param[in] SystemTable The system table.
26 @retval EFI_ALREADY_STARTED The driver already exists in system.
27 @retval EFI_OUT_OF_RESOURCES Fail to execute entry point due to lack of resources.
28 @retval EFI_SUCCESS All the related protocols are installed on the driver.
29 @retval Others Fail to get the SecureBootEnable variable.
34 SecureBootDefaultKeysEntryPoint (
35 IN EFI_HANDLE ImageHandle
,
36 IN EFI_SYSTEM_TABLE
*SystemTable
41 Status
= SecureBootInitPKDefault ();
42 if (EFI_ERROR (Status
)) {
43 DEBUG((DEBUG_ERROR
, "%a: Cannot initialize PKDefault: %r\n", __FUNCTION__
, Status
));
47 Status
= SecureBootInitKEKDefault ();
48 if (EFI_ERROR (Status
)) {
49 DEBUG ((DEBUG_ERROR
, "%a: Cannot initialize KEKDefault: %r\n", __FUNCTION__
, Status
));
52 Status
= SecureBootInitDbDefault ();
53 if (EFI_ERROR (Status
)) {
54 DEBUG ((DEBUG_ERROR
, "%a: Cannot initialize dbDefault: %r\n", __FUNCTION__
, Status
));
58 Status
= SecureBootInitDbtDefault ();
59 if (EFI_ERROR (Status
)) {
60 DEBUG ((DEBUG_INFO
, "%a: dbtDefault not initialized\n", __FUNCTION__
));
63 Status
= SecureBootInitDbxDefault ();
64 if (EFI_ERROR (Status
)) {
65 DEBUG ((DEBUG_INFO
, "%a: dbxDefault not initialized\n", __FUNCTION__
));