]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/UserCredential.h
OvmfPkg: Skip initrd command on Xcode toolchain
[mirror_edk2.git] / MdePkg / Include / Protocol / UserCredential.h
... / ...
CommitLineData
1/** @file\r
2 UEFI 2.2 User Credential Protocol definition.It has been removed from UEFI 2.3.1 and replaced\r
3 by EFI_USER_CREDENTIAL2_PROTOCOL.\r
4\r
5 Attached to a device handle, this protocol identifies a single means of identifying the user.\r
6\r
7 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
9\r
10**/\r
11\r
12#ifndef __USER_CREDENTIAL_H__\r
13#define __USER_CREDENTIAL_H__\r
14\r
15#include <Protocol/UserManager.h>\r
16\r
17#define EFI_USER_CREDENTIAL_PROTOCOL_GUID \\r
18 { \\r
19 0x71ee5e94, 0x65b9, 0x45d5, { 0x82, 0x1a, 0x3a, 0x4d, 0x86, 0xcf, 0xe6, 0xbe } \\r
20 }\r
21\r
22typedef struct _EFI_USER_CREDENTIAL_PROTOCOL EFI_USER_CREDENTIAL_PROTOCOL;\r
23\r
24/**\r
25 Enroll a user on a credential provider.\r
26\r
27 This function enrolls and deletes a user profile using this credential provider. If a user profile\r
28 is successfully enrolled, it calls the User Manager Protocol function Notify() to notify the user\r
29 manager driver that credential information has changed. If an enrolled user does exist, delete the\r
30 user on the credential provider.\r
31\r
32 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
33 @param[in] User The user profile to enroll.\r
34\r
35 @retval EFI_SUCCESS User profile was successfully enrolled.\r
36 @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the user profile\r
37 handle. Either the user profile cannot enroll on any user profile or\r
38 cannot enroll on a user profile other than the current user profile.\r
39 @retval EFI_UNSUPPORTED This credential provider does not support enrollment in the pre-OS.\r
40 @retval EFI_DEVICE_ERROR The new credential could not be created because of a device error.\r
41 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.\r
42**/\r
43typedef\r
44EFI_STATUS\r
45(EFIAPI *EFI_CREDENTIAL_ENROLL)(\r
46 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
47 IN EFI_USER_PROFILE_HANDLE User\r
48 );\r
49\r
50/**\r
51 Returns the user interface information used during user identification.\r
52\r
53 This function returns information about the form used when interacting with the user during user\r
54 identification. The form is the first enabled form in the form-set class\r
55 EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If\r
56 the user credential provider does not require a form to identify the user, then this function should\r
57 return EFI_NOT_FOUND.\r
58\r
59 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
60 @param[out] Hii On return, holds the HII database handle.\r
61 @param[out] FormSetId On return, holds the identifier of the form set which contains\r
62 the form used during user identification.\r
63 @param[out] FormId On return, holds the identifier of the form used during user\r
64 identification.\r
65\r
66 @retval EFI_SUCCESS Form returned successfully.\r
67 @retval EFI_NOT_FOUND Form not returned.\r
68 @retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL.\r
69**/\r
70typedef\r
71EFI_STATUS\r
72(EFIAPI *EFI_CREDENTIAL_FORM)(\r
73 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
74 OUT EFI_HII_HANDLE *Hii,\r
75 OUT EFI_GUID *FormSetId,\r
76 OUT EFI_FORM_ID *FormId\r
77 );\r
78\r
79/**\r
80 Returns bitmap used to describe the credential provider type.\r
81\r
82 This optional function returns a bitmap which is less than or equal to the number of pixels specified\r
83 by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND is returned.\r
84\r
85 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
86 @param[in, out] Width On entry, points to the desired bitmap width. If NULL then no bitmap\r
87 information will be returned. On exit, points to the width of the\r
88 bitmap returned.\r
89 @param[in, out] Height On entry, points to the desired bitmap height. If NULL then no bitmap\r
90 information will be returned. On exit, points to the height of the\r
91 bitmap returned\r
92 @param[out] Hii On return, holds the HII database handle.\r
93 @param[out] Image On return, holds the HII image identifier.\r
94\r
95 @retval EFI_SUCCESS Image identifier returned successfully.\r
96 @retval EFI_NOT_FOUND Image identifier not returned.\r
97 @retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL.\r
98**/\r
99typedef\r
100EFI_STATUS\r
101(EFIAPI *EFI_CREDENTIAL_TILE)(\r
102 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
103 IN OUT UINTN *Width,\r
104 IN OUT UINTN *Height,\r
105 OUT EFI_HII_HANDLE *Hii,\r
106 OUT EFI_IMAGE_ID *Image\r
107 );\r
108\r
109/**\r
110 Returns string used to describe the credential provider type.\r
111\r
112 This function returns a string which describes the credential provider. If no such string exists, then\r
113 EFI_NOT_FOUND is returned.\r
114\r
115 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
116 @param[out] Hii On return, holds the HII database handle.\r
117 @param[out] String On return, holds the HII string identifier.\r
118\r
119 @retval EFI_SUCCESS String identifier returned successfully.\r
120 @retval EFI_NOT_FOUND String identifier not returned.\r
121 @retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL.\r
122**/\r
123typedef\r
124EFI_STATUS\r
125(EFIAPI *EFI_CREDENTIAL_TITLE)(\r
126 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
127 OUT EFI_HII_HANDLE *Hii,\r
128 OUT EFI_STRING_ID *String\r
129 );\r
130\r
131/**\r
132 Return the user identifier associated with the currently authenticated user.\r
133\r
134 This function returns the user identifier of the user authenticated by this credential provider. This\r
135 function is called after the credential-related information has been submitted on a form OR after a\r
136 call to Default() has returned that this credential is ready to log on.\r
137\r
138 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
139 @param[in] User The user profile handle of the user profile currently being considered\r
140 by the user identity manager. If NULL, then no user profile is currently\r
141 under consideration.\r
142 @param[out] Identifier On return, points to the user identifier.\r
143\r
144 @retval EFI_SUCCESS User identifier returned successfully.\r
145 @retval EFI_NOT_READY No user identifier can be returned.\r
146 @retval EFI_ACCESS_DENIED The user has been locked out of this user credential.\r
147 @retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be found in user\r
148 profile database\r
149 @retval EFI_INVALID_PARAMETER Identifier is NULL.\r
150**/\r
151typedef\r
152EFI_STATUS\r
153(EFIAPI *EFI_CREDENTIAL_USER)(\r
154 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
155 IN EFI_USER_PROFILE_HANDLE User,\r
156 OUT EFI_USER_INFO_IDENTIFIER *Identifier\r
157 );\r
158\r
159/**\r
160 Indicate that user interface interaction has begun for the specified credential.\r
161\r
162 This function is called when a credential provider is selected by the user. If AutoLogon returns\r
163 FALSE, then the user interface will be constructed by the User Identity Manager.\r
164\r
165 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
166 @param[out] AutoLogon On return, points to the credential provider's capabilities after\r
167 the credential provider has been selected by the user.\r
168\r
169 @retval EFI_SUCCESS Credential provider successfully selected.\r
170 @retval EFI_INVALID_PARAMETER AutoLogon is NULL.\r
171**/\r
172typedef\r
173EFI_STATUS\r
174(EFIAPI *EFI_CREDENTIAL_SELECT)(\r
175 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
176 OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon\r
177 );\r
178\r
179/**\r
180 Indicate that user interface interaction has ended for the specified credential.\r
181\r
182 This function is called when a credential provider is deselected by the user.\r
183\r
184 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
185\r
186 @retval EFI_SUCCESS Credential provider successfully deselected.\r
187**/\r
188typedef\r
189EFI_STATUS\r
190(EFIAPI *EFI_CREDENTIAL_DESELECT)(\r
191 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This\r
192 );\r
193\r
194/**\r
195 Return the default logon behavior for this user credential.\r
196\r
197 This function reports the default login behavior regarding this credential provider.\r
198\r
199 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
200 @param[out] AutoLogon On return, holds whether the credential provider should be\r
201 used by default to automatically log on the user.\r
202\r
203 @retval EFI_SUCCESS Default information successfully returned.\r
204 @retval EFI_INVALID_PARAMETER AutoLogon is NULL.\r
205**/\r
206typedef\r
207EFI_STATUS\r
208(EFIAPI *EFI_CREDENTIAL_DEFAULT)(\r
209 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
210 OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon\r
211 );\r
212\r
213/**\r
214 Return information attached to the credential provider.\r
215\r
216 This function returns user information.\r
217\r
218 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
219 @param[in] UserInfo Handle of the user information data record.\r
220 @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On exit, holds the user\r
221 information. If the buffer is too small to hold the information, then\r
222 EFI_BUFFER_TOO_SMALL is returned and InfoSize is updated to contain the\r
223 number of bytes actually required.\r
224 @param[in,out] InfoSize On entry, points to the size of Info. On return, points to the size of the user\r
225 information.\r
226\r
227 @retval EFI_SUCCESS Information returned successfully.\r
228 @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the user\r
229 information. The size required is returned in *InfoSize.\r
230 @retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.\r
231 @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.\r
232**/\r
233typedef\r
234EFI_STATUS\r
235(EFIAPI *EFI_CREDENTIAL_GET_INFO)(\r
236 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
237 IN EFI_USER_INFO_HANDLE UserInfo,\r
238 OUT EFI_USER_INFO *Info,\r
239 IN OUT UINTN *InfoSize\r
240 );\r
241\r
242/**\r
243 Enumerate all of the user information records on the credential provider.\r
244\r
245 This function returns the next user information record. To retrieve the first user information record\r
246 handle, point UserInfo at a NULL. Each subsequent call will retrieve another user information\r
247 record handle until there are no more, at which point UserInfo will point to NULL.\r
248\r
249 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
250 @param[in,out] UserInfo On entry, points to the previous user information handle or NULL to\r
251 start enumeration. On exit, points to the next user information handle\r
252 or NULL if there is no more user information.\r
253\r
254 @retval EFI_SUCCESS User information returned.\r
255 @retval EFI_NOT_FOUND No more user information found.\r
256 @retval EFI_INVALID_PARAMETER UserInfo is NULL.\r
257**/\r
258typedef\r
259EFI_STATUS\r
260(EFIAPI *EFI_CREDENTIAL_GET_NEXT_INFO)(\r
261 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
262 IN OUT EFI_USER_INFO_HANDLE *UserInfo\r
263 );\r
264\r
265///\r
266/// This protocol provides support for a single class of credentials\r
267///\r
268struct _EFI_USER_CREDENTIAL_PROTOCOL {\r
269 EFI_GUID Identifier; ///< Uniquely identifies this credential provider.\r
270 EFI_GUID Type; ///< Identifies this class of User Credential Provider.\r
271 EFI_CREDENTIAL_ENROLL Enroll;\r
272 EFI_CREDENTIAL_FORM Form;\r
273 EFI_CREDENTIAL_TILE Tile;\r
274 EFI_CREDENTIAL_TITLE Title;\r
275 EFI_CREDENTIAL_USER User;\r
276 EFI_CREDENTIAL_SELECT Select;\r
277 EFI_CREDENTIAL_DESELECT Deselect;\r
278 EFI_CREDENTIAL_DEFAULT Default;\r
279 EFI_CREDENTIAL_GET_INFO GetInfo;\r
280 EFI_CREDENTIAL_GET_NEXT_INFO GetNextInfo;\r
281 EFI_CREDENTIAL_CAPABILITIES Capabilities;\r
282};\r
283\r
284extern EFI_GUID gEfiUserCredentialProtocolGuid;\r
285\r
286#endif\r