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