]>
Commit | Line | Data |
---|---|---|
1c837cd5 | 1 | /** @file\r |
2 | \r | |
99383667 | 3 | Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>\r |
1c837cd5 | 4 | \r |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions\r | |
7 | of the BSD License which accompanies this distribution. The\r | |
8 | full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #include <Uefi.h>\r | |
17 | #include <Library/DebugLib.h>\r | |
18 | \r | |
19 | /**\r | |
20 | This function will save confidential information to lockbox.\r | |
21 | \r | |
22 | @param Guid the guid to identify the confidential information\r | |
23 | @param Buffer the address of the confidential information\r | |
24 | @param Length the length of the confidential information\r | |
25 | \r | |
26 | @retval RETURN_SUCCESS the information is saved successfully.\r | |
27 | @retval RETURN_INVALID_PARAMETER the Guid is NULL, or Buffer is NULL, or Length is 0\r | |
28 | @retval RETURN_ALREADY_STARTED the requested GUID already exist.\r | |
29 | @retval RETURN_OUT_OF_RESOURCES no enough resource to save the information.\r | |
30 | @retval RETURN_ACCESS_DENIED it is too late to invoke this interface\r | |
31 | @retval RETURN_NOT_STARTED it is too early to invoke this interface\r | |
32 | @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r | |
33 | **/\r | |
34 | RETURN_STATUS\r | |
35 | EFIAPI\r | |
36 | SaveLockBox (\r | |
37 | IN GUID *Guid,\r | |
38 | IN VOID *Buffer,\r | |
39 | IN UINTN Length\r | |
40 | )\r | |
41 | {\r | |
42 | return RETURN_SUCCESS;\r | |
43 | }\r | |
44 | \r | |
45 | /**\r | |
46 | This function will set lockbox attributes.\r | |
47 | \r | |
48 | @param Guid the guid to identify the confidential information\r | |
49 | @param Attributes the attributes of the lockbox\r | |
50 | \r | |
51 | @retval RETURN_SUCCESS the information is saved successfully.\r | |
52 | @retval RETURN_INVALID_PARAMETER attributes is invalid.\r | |
53 | @retval RETURN_NOT_FOUND the requested GUID not found.\r | |
54 | @retval RETURN_ACCESS_DENIED it is too late to invoke this interface\r | |
55 | @retval RETURN_NOT_STARTED it is too early to invoke this interface\r | |
56 | @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r | |
57 | **/\r | |
58 | RETURN_STATUS\r | |
59 | EFIAPI\r | |
60 | SetLockBoxAttributes (\r | |
61 | IN GUID *Guid,\r | |
62 | IN UINT64 Attributes\r | |
63 | )\r | |
64 | {\r | |
65 | return RETURN_SUCCESS;\r | |
66 | }\r | |
67 | \r | |
68 | /**\r | |
69 | This function will update confidential information to lockbox.\r | |
70 | \r | |
71 | @param Guid the guid to identify the original confidential information\r | |
72 | @param Offset the offset of the original confidential information\r | |
73 | @param Buffer the address of the updated confidential information\r | |
74 | @param Length the length of the updated confidential information\r | |
75 | \r | |
76 | @retval RETURN_SUCCESS the information is saved successfully.\r | |
77 | @retval RETURN_INVALID_PARAMETER the Guid is NULL, or Buffer is NULL, or Length is 0.\r | |
78 | @retval RETURN_NOT_FOUND the requested GUID not found.\r | |
99383667 HW |
79 | @retval RETURN_BUFFER_TOO_SMALL for lockbox without attribute LOCK_BOX_ATTRIBUTE_RESTORE_IN_S3_ONLY,\r |
80 | the original buffer to too small to hold new information.\r | |
81 | @retval RETURN_OUT_OF_RESOURCES for lockbox with attribute LOCK_BOX_ATTRIBUTE_RESTORE_IN_S3_ONLY,\r | |
82 | no enough resource to save the information.\r | |
1c837cd5 | 83 | @retval RETURN_ACCESS_DENIED it is too late to invoke this interface\r |
84 | @retval RETURN_NOT_STARTED it is too early to invoke this interface\r | |
85 | @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r | |
86 | **/\r | |
87 | RETURN_STATUS\r | |
88 | EFIAPI\r | |
89 | UpdateLockBox (\r | |
90 | IN GUID *Guid,\r | |
91 | IN UINTN Offset,\r | |
92 | IN VOID *Buffer,\r | |
93 | IN UINTN Length\r | |
94 | )\r | |
95 | {\r | |
96 | return RETURN_SUCCESS;\r | |
97 | }\r | |
98 | \r | |
99 | /**\r | |
100 | This function will restore confidential information from lockbox.\r | |
101 | \r | |
102 | @param Guid the guid to identify the confidential information\r | |
103 | @param Buffer the address of the restored confidential information\r | |
104 | NULL means restored to original address, Length MUST be NULL at same time.\r | |
105 | @param Length the length of the restored confidential information\r | |
106 | \r | |
107 | @retval RETURN_SUCCESS the information is restored successfully.\r | |
108 | @retval RETURN_INVALID_PARAMETER the Guid is NULL, or one of Buffer and Length is NULL.\r | |
d1102dba | 109 | @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no\r |
1c837cd5 | 110 | LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute.\r |
111 | @retval RETURN_BUFFER_TOO_SMALL the Length is too small to hold the confidential information.\r | |
112 | @retval RETURN_NOT_FOUND the requested GUID not found.\r | |
113 | @retval RETURN_NOT_STARTED it is too early to invoke this interface\r | |
114 | @retval RETURN_ACCESS_DENIED not allow to restore to the address\r | |
115 | @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r | |
116 | **/\r | |
117 | RETURN_STATUS\r | |
118 | EFIAPI\r | |
119 | RestoreLockBox (\r | |
120 | IN GUID *Guid,\r | |
121 | IN VOID *Buffer, OPTIONAL\r | |
122 | IN OUT UINTN *Length OPTIONAL\r | |
123 | )\r | |
124 | {\r | |
125 | return RETURN_SUCCESS;\r | |
126 | }\r | |
127 | \r | |
128 | /**\r | |
129 | This function will restore confidential information from all lockbox which have RestoreInPlace attribute.\r | |
130 | \r | |
131 | @retval RETURN_SUCCESS the information is restored successfully.\r | |
132 | @retval RETURN_NOT_STARTED it is too early to invoke this interface\r | |
133 | @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r | |
134 | **/\r | |
135 | RETURN_STATUS\r | |
136 | EFIAPI\r | |
137 | RestoreAllLockBoxInPlace (\r | |
138 | VOID\r | |
139 | )\r | |
140 | {\r | |
141 | return RETURN_SUCCESS;\r | |
142 | }\r |