]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Include/Library/SecureBootVariableProvisionLib.h
SecurityPkg: Create library for enrolling Secure Boot variables.
[mirror_edk2.git] / SecurityPkg / Include / Library / SecureBootVariableProvisionLib.h
1 /** @file
2 Provides a functions to enroll keys based on default values.
3
4 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
5 (C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
6 Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
7 Copyright (c) 2021, Semihalf All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10 **/
11
12 #ifndef SECURE_BOOT_VARIABLE_PROVISION_LIB_H_
13 #define SECURE_BOOT_VARIABLE_PROVISION_LIB_H_
14
15 /**
16 Sets the content of the 'db' variable based on 'dbDefault' variable content.
17
18 @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
19 while VendorGuid is NULL.
20 @retval other Errors from GetVariable2(), GetTime() and SetVariable()
21 --*/
22 EFI_STATUS
23 EFIAPI
24 EnrollDbFromDefault (
25 VOID
26 );
27
28 /**
29 Sets the content of the 'dbx' variable based on 'dbxDefault' variable content.
30
31 @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
32 while VendorGuid is NULL.
33 @retval other Errors from GetVariable2(), GetTime() and SetVariable()
34 --*/
35 EFI_STATUS
36 EFIAPI
37 EnrollDbxFromDefault (
38 VOID
39 );
40
41 /**
42 Sets the content of the 'dbt' variable based on 'dbtDefault' variable content.
43
44 @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
45 while VendorGuid is NULL.
46 @retval other Errors from GetVariable2(), GetTime() and SetVariable()
47 --*/
48 EFI_STATUS
49 EFIAPI
50 EnrollDbtFromDefault (
51 VOID
52 );
53
54 /**
55 Sets the content of the 'KEK' variable based on 'KEKDefault' variable content.
56
57 @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
58 while VendorGuid is NULL.
59 @retval other Errors from GetVariable2(), GetTime() and SetVariable()
60 --*/
61 EFI_STATUS
62 EFIAPI
63 EnrollKEKFromDefault (
64 VOID
65 );
66
67 /**
68 Sets the content of the 'PK' variable based on 'PKDefault' variable content.
69
70 @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
71 while VendorGuid is NULL.
72 @retval other Errors from GetVariable2(), GetTime() and SetVariable()
73 --*/
74 EFI_STATUS
75 EFIAPI
76 EnrollPKFromDefault (
77 VOID
78 );
79
80 /**
81 Initializes PKDefault variable with data from FFS section.
82
83 @retval EFI_SUCCESS Variable was initialized successfully.
84 @retval EFI_UNSUPPORTED Variable already exists.
85 --*/
86 EFI_STATUS
87 SecureBootInitPKDefault (
88 IN VOID
89 );
90
91 /**
92 Initializes KEKDefault variable with data from FFS section.
93
94 @retval EFI_SUCCESS Variable was initialized successfully.
95 @retval EFI_UNSUPPORTED Variable already exists.
96 --*/
97 EFI_STATUS
98 SecureBootInitKEKDefault (
99 IN VOID
100 );
101
102 /**
103 Initializes dbDefault variable with data from FFS section.
104
105 @retval EFI_SUCCESS Variable was initialized successfully.
106 @retval EFI_UNSUPPORTED Variable already exists.
107 --*/
108 EFI_STATUS
109 SecureBootInitDbDefault (
110 IN VOID
111 );
112
113 /**
114 Initializes dbtDefault variable with data from FFS section.
115
116 @retval EFI_SUCCESS Variable was initialized successfully.
117 @retval EFI_UNSUPPORTED Variable already exists.
118 --*/
119 EFI_STATUS
120 SecureBootInitDbtDefault (
121 IN VOID
122 );
123
124 /**
125 Initializes dbxDefault variable with data from FFS section.
126
127 @retval EFI_SUCCESS Variable was initialized successfully.
128 @retval EFI_UNSUPPORTED Variable already exists.
129 --*/
130 EFI_STATUS
131 SecureBootInitDbxDefault (
132 IN VOID
133 );
134 #endif