2 Password Credential Provider driver header file.
4 Copyright (c) 2009 - 2011, 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
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.
15 #ifndef _PASSWORD_CREDENTIAL_PROVIDER_H_
16 #define _PASSWORD_CREDENTIAL_PROVIDER_H_
20 #include <Guid/GlobalVariable.h>
22 #include <Protocol/HiiConfigAccess.h>
23 #include <Protocol/UserCredential2.h>
24 #include <Protocol/UserManager.h>
26 #include <Library/UefiRuntimeServicesTableLib.h>
27 #include <Library/UefiBootServicesTableLib.h>
28 #include <Library/MemoryAllocationLib.h>
29 #include <Library/BaseMemoryLib.h>
30 #include <Library/DevicePathLib.h>
31 #include <Library/DebugLib.h>
32 #include <Library/UefiLib.h>
33 #include <Library/PrintLib.h>
34 #include <Library/HiiLib.h>
35 #include <Library/BaseCryptLib.h>
37 #include "PwdCredentialProviderData.h"
39 extern UINT8 PwdCredentialProviderStrings
[];
40 extern UINT8 PwdCredentialProviderVfrBin
[];
42 #define PASSWORD_TABLE_INC 16
43 #define CREDENTIAL_LEN 20
46 // Password credential information.
49 EFI_USER_INFO_IDENTIFIER UserId
;
50 CHAR8 Password
[CREDENTIAL_LEN
];
54 // Password credential table.
60 PASSWORD_INFO UserInfo
[1];
64 // The user information on the password provider.
68 EFI_USER_INFO
*Info
[1];
69 } PASSWORD_CREDENTIAL_INFO
;
72 /// HII specific Vendor Device Path definition.
75 VENDOR_DEVICE_PATH VendorDevicePath
;
76 EFI_DEVICE_PATH_PROTOCOL End
;
77 } HII_VENDOR_DEVICE_PATH
;
79 #define PWD_PROVIDER_SIGNATURE SIGNATURE_32 ('P', 'W', 'D', 'P')
83 EFI_HANDLE DriverHandle
;
84 EFI_HII_HANDLE HiiHandle
;
88 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess
;
89 } PWD_PROVIDER_CALLBACK_INFO
;
93 Enroll a user on a credential provider.
95 This function enrolls a user on this credential provider. If the user exists on
96 this credential provider, update the user information on this credential provider;
97 otherwise delete the user information on credential provider.
99 @param[in] This Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL.
100 @param[in] User The user profile to enroll.
102 @retval EFI_SUCCESS User profile was successfully enrolled.
103 @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the
104 user profile handle. Either the user profile cannot enroll
105 on any user profile or cannot enroll on a user profile
106 other than the current user profile.
107 @retval EFI_UNSUPPORTED This credential provider does not support enrollment in
109 @retval EFI_DEVICE_ERROR The new credential could not be created because of a device
111 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
117 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
,
118 IN EFI_USER_PROFILE_HANDLE User
122 Returns the user interface information used during user identification.
124 This function returns information about the form used when interacting with the
125 user during user identification. The form is the first enabled form in the form-set
126 class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
127 the user credential provider does not require a form to identify the user, then this
128 function should return EFI_NOT_FOUND.
130 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
131 @param[out] Hii On return, holds the HII database handle.
132 @param[out] FormSetId On return, holds the identifier of the form set which contains
133 the form used during user identification.
134 @param[out] FormId On return, holds the identifier of the form used during user
137 @retval EFI_SUCCESS Form returned successfully.
138 @retval EFI_NOT_FOUND Form not returned.
139 @retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL.
145 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
,
146 OUT EFI_HII_HANDLE
*Hii
,
147 OUT EFI_GUID
*FormSetId
,
148 OUT EFI_FORM_ID
*FormId
152 Returns bitmap used to describe the credential provider type.
154 This optional function returns a bitmap which is less than or equal to the number
155 of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND
158 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
159 @param[in, out] Width On entry, points to the desired bitmap width. If NULL then no
160 bitmap information will be returned. On exit, points to the
161 width of the bitmap returned.
162 @param[in, out] Height On entry, points to the desired bitmap height. If NULL then no
163 bitmap information will be returned. On exit, points to the
164 height of the bitmap returned
165 @param[out] Hii On return, holds the HII database handle.
166 @param[out] Image On return, holds the HII image identifier.
168 @retval EFI_SUCCESS Image identifier returned successfully.
169 @retval EFI_NOT_FOUND Image identifier not returned.
170 @retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL.
176 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
,
178 IN OUT UINTN
*Height
,
179 OUT EFI_HII_HANDLE
*Hii
,
180 OUT EFI_IMAGE_ID
*Image
184 Returns string used to describe the credential provider type.
186 This function returns a string which describes the credential provider. If no
187 such string exists, then EFI_NOT_FOUND is returned.
189 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
190 @param[out] Hii On return, holds the HII database handle.
191 @param[out] String On return, holds the HII string identifier.
193 @retval EFI_SUCCESS String identifier returned successfully.
194 @retval EFI_NOT_FOUND String identifier not returned.
195 @retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL.
201 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
,
202 OUT EFI_HII_HANDLE
*Hii
,
203 OUT EFI_STRING_ID
*String
207 Return the user identifier associated with the currently authenticated user.
209 This function returns the user identifier of the user authenticated by this credential
210 provider. This function is called after the credential-related information has been
211 submitted on a form OR after a call to Default() has returned that this credential is
214 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
215 @param[in] User The user profile handle of the user profile currently being
216 considered by the user identity manager. If NULL, then no user
217 profile is currently under consideration.
218 @param[out] Identifier On return, points to the user identifier.
220 @retval EFI_SUCCESS User identifier returned successfully.
221 @retval EFI_NOT_READY No user identifier can be returned.
222 @retval EFI_ACCESS_DENIED The user has been locked out of this user credential.
223 @retval EFI_INVALID_PARAMETER This is NULL, or Identifier is NULL.
224 @retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be
225 found in user profile database
231 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
,
232 IN EFI_USER_PROFILE_HANDLE User
,
233 OUT EFI_USER_INFO_IDENTIFIER
*Identifier
237 Indicate that user interface interaction has begun for the specified credential.
239 This function is called when a credential provider is selected by the user. If
240 AutoLogon returns FALSE, then the user interface will be constructed by the User
243 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
244 @param[out] AutoLogon On return, points to the credential provider's capabilities
245 after the credential provider has been selected by the user.
247 @retval EFI_SUCCESS Credential provider successfully selected.
248 @retval EFI_INVALID_PARAMETER AutoLogon is NULL.
254 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
,
255 OUT EFI_CREDENTIAL_LOGON_FLAGS
*AutoLogon
259 Indicate that user interface interaction has ended for the specified credential.
261 This function is called when a credential provider is deselected by the user.
263 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
265 @retval EFI_SUCCESS Credential provider successfully deselected.
271 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
275 Return the default logon behavior for this user credential.
277 This function reports the default login behavior regarding this credential provider.
279 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
280 @param[out] AutoLogon On return, holds whether the credential provider should be used
281 by default to automatically log on the user.
283 @retval EFI_SUCCESS Default information successfully returned.
284 @retval EFI_INVALID_PARAMETER AutoLogon is NULL.
290 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
,
291 OUT EFI_CREDENTIAL_LOGON_FLAGS
*AutoLogon
295 Return information attached to the credential provider.
297 This function returns user information.
299 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
300 @param[in] UserInfo Handle of the user information data record.
301 @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On
302 exit, holds the user information. If the buffer is too small
303 to hold the information, then EFI_BUFFER_TOO_SMALL is returned
304 and InfoSize is updated to contain the number of bytes actually
306 @param[in, out] InfoSize On entry, points to the size of Info. On return, points to the
307 size of the user information.
309 @retval EFI_SUCCESS Information returned successfully.
310 @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the
311 user information. The size required is returned in *InfoSize.
312 @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
313 @retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
319 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
,
320 IN EFI_USER_INFO_HANDLE UserInfo
,
321 OUT EFI_USER_INFO
*Info
,
322 IN OUT UINTN
*InfoSize
327 Enumerate all of the user informations on the credential provider.
329 This function returns the next user information record. To retrieve the first user
330 information record handle, point UserInfo at a NULL. Each subsequent call will retrieve
331 another user information record handle until there are no more, at which point UserInfo
334 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
335 @param[in, out] UserInfo On entry, points to the previous user information handle or NULL
336 to start enumeration. On exit, points to the next user information
337 handle or NULL if there is no more user information.
339 @retval EFI_SUCCESS User information returned.
340 @retval EFI_NOT_FOUND No more user information found.
341 @retval EFI_INVALID_PARAMETER UserInfo is NULL.
346 CredentialGetNextInfo (
347 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
,
348 IN OUT EFI_USER_INFO_HANDLE
*UserInfo
352 Delete a user on this credential provider.
354 This function deletes a user on this credential provider.
356 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
357 @param[in] User The user profile handle to delete.
359 @retval EFI_SUCCESS User profile was successfully deleted.
360 @retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle.
361 Either the user profile cannot delete on any user profile or cannot delete
362 on a user profile other than the current user profile.
363 @retval EFI_UNSUPPORTED This credential provider does not support deletion in the pre-OS.
364 @retval EFI_DEVICE_ERROR The new credential could not be deleted because of a device error.
365 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
370 IN CONST EFI_USER_CREDENTIAL2_PROTOCOL
*This
,
371 IN EFI_USER_PROFILE_HANDLE User