]>
Commit | Line | Data |
---|---|---|
b6477d82 SZ |
1 | /** @file\r |
2 | Implements NULL authenticated variable services.\r | |
3 | \r | |
4 | Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #include <Library/AuthVariableLib.h>\r | |
16 | #include <Library/DebugLib.h>\r | |
17 | \r | |
18 | /**\r | |
19 | Initialization for authenticated varibale services.\r | |
20 | If this initialization returns error status, other APIs will not work\r | |
21 | and expect to be not called then.\r | |
22 | \r | |
23 | @param[in] AuthVarLibContextIn Pointer to input auth variable lib context.\r | |
24 | @param[out] AuthVarLibContextOut Pointer to output auth variable lib context.\r | |
25 | \r | |
26 | @retval EFI_SUCCESS Function successfully executed.\r | |
27 | @retval EFI_INVALID_PARAMETER If AuthVarLibContextIn == NULL or AuthVarLibContextOut == NULL.\r | |
28 | @retval EFI_OUT_OF_RESOURCES Fail to allocate enough resource.\r | |
29 | @retval EFI_UNSUPPORTED Unsupported to process authenticated variable.\r | |
30 | \r | |
31 | **/\r | |
32 | EFI_STATUS\r | |
33 | EFIAPI\r | |
34 | AuthVariableLibInitialize (\r | |
35 | IN AUTH_VAR_LIB_CONTEXT_IN *AuthVarLibContextIn,\r | |
36 | OUT AUTH_VAR_LIB_CONTEXT_OUT *AuthVarLibContextOut\r | |
37 | )\r | |
38 | {\r | |
39 | //\r | |
40 | // Do nothing, just return EFI_UNSUPPORTED.\r | |
41 | //\r | |
42 | return EFI_UNSUPPORTED;\r | |
43 | }\r | |
44 | \r | |
45 | /**\r | |
46 | Process variable with EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS/EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set.\r | |
47 | \r | |
48 | @param[in] VariableName Name of the variable.\r | |
49 | @param[in] VendorGuid Variable vendor GUID.\r | |
50 | @param[in] Data Data pointer.\r | |
51 | @param[in] DataSize Size of Data.\r | |
52 | @param[in] Attributes Attribute value of the variable.\r | |
53 | \r | |
54 | @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as\r | |
55 | defined by the Attributes.\r | |
56 | @retval EFI_INVALID_PARAMETER Invalid parameter.\r | |
57 | @retval EFI_WRITE_PROTECTED Variable is write-protected.\r | |
58 | @retval EFI_OUT_OF_RESOURCES There is not enough resource.\r | |
59 | @retval EFI_SECURITY_VIOLATION The variable is with EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\r | |
60 | or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS\r | |
61 | set, but the AuthInfo does NOT pass the validation\r | |
62 | check carried out by the firmware.\r | |
63 | @retval EFI_UNSUPPORTED Unsupported to process authenticated variable.\r | |
64 | \r | |
65 | **/\r | |
66 | EFI_STATUS\r | |
67 | EFIAPI\r | |
68 | AuthVariableLibProcessVariable (\r | |
69 | IN CHAR16 *VariableName,\r | |
70 | IN EFI_GUID *VendorGuid,\r | |
71 | IN VOID *Data,\r | |
72 | IN UINTN DataSize,\r | |
73 | IN UINT32 Attributes\r | |
74 | )\r | |
75 | {\r | |
76 | ASSERT (FALSE);\r | |
77 | return EFI_UNSUPPORTED;\r | |
78 | }\r |