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