]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/LockBoxLib.h
2 This library is only intended to be used by DXE modules that need save
3 confidential information to LockBox and get it by PEI modules in S3 phase.
5 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions
9 of the BSD License which accompanies this distribution. The
10 full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #ifndef _LOCK_BOX_LIB_H_
19 #define _LOCK_BOX_LIB_H_
22 This function will save confidential information to lockbox.
24 @param Guid the guid to identify the confidential information
25 @param Buffer the address of the confidential information
26 @param Length the length of the confidential information
28 @retval RETURN_SUCCESS the information is saved successfully.
29 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or Buffer is NULL, or Length is 0
30 @retval RETURN_ALREADY_STARTED the requested GUID already exist.
31 @retval RETURN_OUT_OF_RESOURCES no enough resource to save the information.
32 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface
33 @retval RETURN_NOT_STARTED it is too early to invoke this interface
34 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.
45 This function will set lockbox attributes.
47 @param Guid the guid to identify the confidential information
48 @param Attributes the attributes of the lockbox
50 @retval RETURN_SUCCESS the information is saved successfully.
51 @retval RETURN_INVALID_PARAMETER attributes is invalid.
52 @retval RETURN_NOT_FOUND the requested GUID not found.
53 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface
54 @retval RETURN_NOT_STARTED it is too early to invoke this interface
55 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.
59 SetLockBoxAttributes (
65 // With this flag, this LockBox can be restored to this Buffer with RestoreAllLockBoxInPlace()
67 #define LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE BIT0
70 This function will update confidential information to lockbox.
72 @param Guid the guid to identify the original confidential information
73 @param Offset the offset of the original confidential information
74 @param Buffer the address of the updated confidential information
75 @param Length the length of the updated confidential information
77 @retval RETURN_SUCCESS the information is saved successfully.
78 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or Buffer is NULL, or Length is 0.
79 @retval RETURN_NOT_FOUND the requested GUID not found.
80 @retval RETURN_BUFFER_TOO_SMALL the original buffer to too small to hold new information.
81 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface
82 @retval RETURN_NOT_STARTED it is too early to invoke this interface
83 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.
95 This function will restore confidential information from lockbox.
97 @param Guid the guid to identify the confidential information
98 @param Buffer the address of the restored confidential information
99 NULL means restored to original address, Length MUST be NULL at same time.
100 @param Length the length of the restored confidential information
102 @retval RETURN_SUCCESS the information is restored successfully.
103 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or one of Buffer and Length is NULL.
104 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no
105 LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute.
106 @retval RETURN_BUFFER_TOO_SMALL the Length is too small to hold the confidential information.
107 @retval RETURN_NOT_FOUND the requested GUID not found.
108 @retval RETURN_NOT_STARTED it is too early to invoke this interface
109 @retval RETURN_ACCESS_DENIED not allow to restore to the address
110 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.
116 IN VOID
*Buffer
, OPTIONAL
117 IN OUT UINTN
*Length OPTIONAL
121 This function will restore confidential information from all lockbox which have RestoreInPlace attribute.
123 @retval RETURN_SUCCESS the information is restored successfully.
124 @retval RETURN_NOT_STARTED it is too early to invoke this interface
125 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.
129 RestoreAllLockBoxInPlace (