]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Library/VariableKeyLibNull/VariableKeyLibNull.c
SecurityPkg: add null version of VariableKeyLib
[mirror_edk2.git] / SecurityPkg / Library / VariableKeyLibNull / VariableKeyLibNull.c
1 /** @file
2 Null version of VariableKeyLib for build purpose. Don't use it in real product.
3
4 Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8 #include <Library/DebugLib.h>
9 #include <Library/VariableKeyLib.h>
10
11 /**
12 Retrieves the key for integrity and/or confidentiality of variables.
13
14 @param[out] VariableKey A pointer to pointer for the variable key buffer.
15 @param[in,out] VariableKeySize The size in bytes of the variable key.
16
17 @retval EFI_SUCCESS The variable key was returned.
18 @retval EFI_DEVICE_ERROR An error occurred while attempting to get the variable key.
19 @retval EFI_ACCESS_DENIED The function was invoked after locking the key interface.
20 @retval EFI_UNSUPPORTED The variable key is not supported in the current boot configuration.
21 **/
22 EFI_STATUS
23 EFIAPI
24 GetVariableKey (
25 OUT VOID **VariableKey,
26 IN OUT UINTN *VariableKeySize
27 )
28 {
29 ASSERT (FALSE);
30 return EFI_UNSUPPORTED;
31 }
32
33 /**
34 Regenerates the variable key.
35
36 @retval EFI_SUCCESS The variable key was regenerated successfully.
37 @retval EFI_DEVICE_ERROR An error occurred while attempting to regenerate the key.
38 @retval EFI_ACCESS_DENIED The function was invoked after locking the key interface.
39 @retval EFI_UNSUPPORTED Key regeneration is not supported in the current boot configuration.
40 **/
41 EFI_STATUS
42 EFIAPI
43 RegenerateVariableKey (
44 VOID
45 )
46 {
47 ASSERT (FALSE);
48 return EFI_UNSUPPORTED;
49 }
50
51 /**
52 Locks the regenerate key interface.
53
54 @retval EFI_SUCCESS The key interface was locked successfully.
55 @retval EFI_UNSUPPORTED Locking the key interface is not supported in the current boot configuration.
56 @retval Others An error occurred while attempting to lock the key interface.
57 **/
58 EFI_STATUS
59 EFIAPI
60 LockVariableKeyInterface (
61 VOID
62 )
63 {
64 ASSERT (FALSE);
65 return EFI_UNSUPPORTED;
66 }
67