SecurityPkg: Clean up source files

1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Liming Gao
2018-06-27 21:13:09 +08:00
parent 5a702acd3d
commit b3548d32dd
224 changed files with 3246 additions and 3246 deletions

View File

@@ -1,14 +1,14 @@
/** @file
Password Credential Provider driver implementation.
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -98,10 +98,10 @@ ExpandTableSize (
// Create new credential table.
//
NewTable = (CREDENTIAL_TABLE *) AllocateZeroPool (
sizeof (CREDENTIAL_TABLE) +
sizeof (CREDENTIAL_TABLE) +
(Count - 1) * sizeof (PASSWORD_INFO)
);
ASSERT (NewTable != NULL);
ASSERT (NewTable != NULL);
NewTable->MaxCount = Count;
NewTable->Count = mPwdTable->Count;
@@ -110,8 +110,8 @@ ExpandTableSize (
// Copy old entries
//
CopyMem (
&NewTable->UserInfo,
&mPwdTable->UserInfo,
&NewTable->UserInfo,
&mPwdTable->UserInfo,
mPwdTable->Count * sizeof (PASSWORD_INFO)
);
FreePool (mPwdTable);
@@ -123,8 +123,8 @@ ExpandTableSize (
Add, update or delete info in table, and sync with NV variable.
@param[in] Index The index of the password in table. If index is found in
table, update the info, else add the into to table.
@param[in] Info The new password info to add into table.If Info is NULL,
table, update the info, else add the into to table.
@param[in] Info The new password info to add into table.If Info is NULL,
delete the info by Index.
@retval EFI_INVALID_PARAMETER Info is NULL when save the info.
@@ -151,7 +151,7 @@ ModifyTable (
mPwdTable->Count--;
if (Index != mPwdTable->Count) {
NewPasswordInfo = &mPwdTable->UserInfo[mPwdTable->Count];
}
}
} else {
//
// Update the specified entry.
@@ -214,9 +214,9 @@ InitCredentialTable (
VarSize = 0;
Var = NULL;
Status = gRT->GetVariable (
L"PwdCredential",
&gPwdCredentialProviderGuid,
NULL,
L"PwdCredential",
&gPwdCredentialProviderGuid,
NULL,
&VarSize,
Var
);
@@ -226,9 +226,9 @@ InitCredentialTable (
return EFI_OUT_OF_RESOURCES;
}
Status = gRT->GetVariable (
L"PwdCredential",
&gPwdCredentialProviderGuid,
NULL,
L"PwdCredential",
&gPwdCredentialProviderGuid,
NULL,
&VarSize,
Var
);
@@ -236,13 +236,13 @@ InitCredentialTable (
if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
return Status;
}
//
// Create the password credential table.
//
mPwdTable = AllocateZeroPool (
sizeof (CREDENTIAL_TABLE) - sizeof (PASSWORD_INFO) +
PASSWORD_TABLE_INC * sizeof (PASSWORD_INFO) +
PASSWORD_TABLE_INC * sizeof (PASSWORD_INFO) +
VarSize
);
if (mPwdTable == NULL) {
@@ -270,7 +270,7 @@ InitCredentialTable (
@retval TRUE Hash the password successfully.
@retval FALSE Failed to hash the password.
**/
BOOLEAN
GenerateCredential (
@@ -282,23 +282,23 @@ GenerateCredential (
BOOLEAN Status;
UINTN HashSize;
VOID *Hash;
HashSize = Sha1GetContextSize ();
Hash = AllocatePool (HashSize);
ASSERT (Hash != NULL);
Status = Sha1Init (Hash);
if (!Status) {
goto Done;
}
Status = Sha1Update (Hash, Password, PasswordSize);
if (!Status) {
goto Done;
}
Status = Sha1Final (Hash, Credential);
Done:
FreePool (Hash);
return Status;
@@ -325,7 +325,7 @@ GetPassword (
UINTN PasswordLen;
CHAR16 *QuestionStr;
CHAR16 *LineStr;
PasswordLen = 0;
while (TRUE) {
PasswordMask[PasswordLen] = L'_';
@@ -346,7 +346,7 @@ GetPassword (
);
FreePool (QuestionStr);
FreePool (LineStr);
//
// Check key stroke
//
@@ -357,8 +357,8 @@ GetPassword (
if (PasswordLen > 0) {
PasswordLen--;
}
} else if ((Key.UnicodeChar == CHAR_NULL) ||
(Key.UnicodeChar == CHAR_TAB) ||
} else if ((Key.UnicodeChar == CHAR_NULL) ||
(Key.UnicodeChar == CHAR_TAB) ||
(Key.UnicodeChar == CHAR_LINEFEED)) {
continue;
} else {
@@ -371,7 +371,7 @@ GetPassword (
}
}
}
PasswordLen = PasswordLen * sizeof (CHAR16);
GenerateCredential (Password, PasswordLen, (UINT8 *)Credential);
}
@@ -392,7 +392,7 @@ CheckPassword (
{
UINTN Index;
CHAR8 *Pwd;
//
// Check password credential.
//
@@ -412,16 +412,16 @@ CheckPassword (
/**
Find a user infomation record by the information record type.
This function searches all user information records of User from beginning
This function searches all user information records of User from beginning
until either the information is found, or there are no more user infomation
records. A match occurs when a Info.InfoType field matches the user information
record type.
@param[in] User Points to the user profile record to search.
@param[in] User Points to the user profile record to search.
@param[in] InfoType The infomation type to be searched.
@param[out] Info Points to the user info found, the caller is responsible
to free.
@retval EFI_SUCCESS Find the user information successfully.
@retval Others Fail to find the user information.
@@ -438,7 +438,7 @@ FindUserInfoByType (
UINTN UserInfoSize;
EFI_USER_INFO_HANDLE UserInfoHandle;
EFI_USER_MANAGER_PROTOCOL *UserManager;
//
// Find user information by information type.
//
@@ -501,7 +501,7 @@ FindUserInfoByType (
if (UserInfo->InfoType == InfoType) {
*Info = UserInfo;
return EFI_SUCCESS;
}
}
}
if (UserInfo != NULL) {
@@ -570,7 +570,7 @@ CredentialDriverCallback (
return Status;
}
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
}
}
return EFI_SUCCESS;
}
@@ -716,24 +716,24 @@ InitFormBrowser (
/**
Enroll a user on a credential provider.
This function enrolls a user on this credential provider. If the user exists on
this credential provider, update the user information on this credential provider;
This function enrolls a user on this credential provider. If the user exists on
this credential provider, update the user information on this credential provider;
otherwise add the user information on credential provider.
@param[in] This Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile to enroll.
@retval EFI_SUCCESS User profile was successfully enrolled.
@retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the
user profile handle. Either the user profile cannot enroll
on any user profile or cannot enroll on a user profile
on any user profile or cannot enroll on a user profile
other than the current user profile.
@retval EFI_UNSUPPORTED This credential provider does not support enrollment in
the pre-OS.
@retval EFI_DEVICE_ERROR The new credential could not be created because of a device
error.
@retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
**/
EFI_STATUS
EFIAPI
@@ -769,12 +769,12 @@ CredentialEnroll (
return EFI_INVALID_PARAMETER;
}
CopyMem (PwdInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER));
CopyMem (PwdInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER));
FreePool (UserInfo);
//
// Get password from user.
//
//
while (TRUE) {
//
// Input password.
@@ -791,10 +791,10 @@ CredentialEnroll (
//
if (CompareMem (PwdInfo.Password, Password, CREDENTIAL_LEN) == 0) {
break;
}
}
QuestionStr = GetStringById (STRING_TOKEN (STR_PASSWORD_MISMATCH));
PromptStr = GetStringById (STRING_TOKEN (STR_INPUT_PASSWORD_AGAIN));
PromptStr = GetStringById (STRING_TOKEN (STR_INPUT_PASSWORD_AGAIN));
CreatePopUp (
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
&Key,
@@ -809,17 +809,17 @@ CredentialEnroll (
//
// Check whether User is ever enrolled in the provider.
//
//
for (Index = 0; Index < mPwdTable->Count; Index++) {
UserId = (UINT8 *) &mPwdTable->UserInfo[Index].UserId;
if (CompareMem (UserId, (UINT8 *) &PwdInfo.UserId, sizeof (EFI_USER_INFO_IDENTIFIER)) == 0) {
//
// User already exists, update the password.
//
//
break;
}
}
//
// Enroll the User to the provider.
//
@@ -837,7 +837,7 @@ CredentialEnroll (
This function returns information about the form used when interacting with the
user during user identification. The form is the first enabled form in the form-set
class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
the user credential provider does not require a form to identify the user, then this
function should return EFI_NOT_FOUND.
@@ -845,13 +845,13 @@ CredentialEnroll (
@param[out] Hii On return, holds the HII database handle.
@param[out] FormSetId On return, holds the identifier of the form set which contains
the form used during user identification.
@param[out] FormId On return, holds the identifier of the form used during user
@param[out] FormId On return, holds the identifier of the form used during user
identification.
@retval EFI_SUCCESS Form returned successfully.
@retval EFI_NOT_FOUND Form not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL.
**/
EFI_STATUS
EFIAPI
@@ -862,7 +862,7 @@ CredentialForm (
OUT EFI_FORM_ID *FormId
)
{
if ((This == NULL) || (Hii == NULL) ||
if ((This == NULL) || (Hii == NULL) ||
(FormSetId == NULL) || (FormId == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -870,7 +870,7 @@ CredentialForm (
*Hii = mCallbackInfo->HiiHandle;
*FormId = FORMID_GET_PASSWORD_FORM;
CopyGuid (FormSetId, &gPwdCredentialProviderGuid);
return EFI_SUCCESS;
}
@@ -880,22 +880,22 @@ CredentialForm (
This optional function returns a bitmap that is less than or equal to the number
of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND
is returned.
is returned.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in, out] Width On entry, points to the desired bitmap width. If NULL then no
bitmap information will be returned. On exit, points to the
@param[in, out] Width On entry, points to the desired bitmap width. If NULL then no
bitmap information will be returned. On exit, points to the
width of the bitmap returned.
@param[in, out] Height On entry, points to the desired bitmap height. If NULL then no
bitmap information will be returned. On exit, points to the
bitmap information will be returned. On exit, points to the
height of the bitmap returned
@param[out] Hii On return, holds the HII database handle.
@param[out] Image On return, holds the HII image identifier.
@param[out] Hii On return, holds the HII database handle.
@param[out] Image On return, holds the HII image identifier.
@retval EFI_SUCCESS Image identifier returned successfully.
@retval EFI_NOT_FOUND Image identifier not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL.
**/
EFI_STATUS
EFIAPI
@@ -906,7 +906,7 @@ CredentialTile (
OUT EFI_HII_HANDLE *Hii,
OUT EFI_IMAGE_ID *Image
)
{
{
if ((This == NULL) || (Hii == NULL) || (Image == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -918,16 +918,16 @@ CredentialTile (
Returns string used to describe the credential provider type.
This function returns a string which describes the credential provider. If no
such string exists, then EFI_NOT_FOUND is returned.
such string exists, then EFI_NOT_FOUND is returned.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] Hii On return, holds the HII database handle.
@param[out] String On return, holds the HII string identifier.
@retval EFI_SUCCESS String identifier returned successfully.
@retval EFI_NOT_FOUND String identifier not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL.
**/
EFI_STATUS
EFIAPI
@@ -940,7 +940,7 @@ CredentialTitle (
if ((This == NULL) || (Hii == NULL) || (String == NULL)) {
return EFI_INVALID_PARAMETER;
}
//
// Set Hii handle and String ID.
//
@@ -955,23 +955,23 @@ CredentialTitle (
Return the user identifier associated with the currently authenticated user.
This function returns the user identifier of the user authenticated by this credential
provider. This function is called after the credential-related information has been
provider. This function is called after the credential-related information has been
submitted on a form, OR after a call to Default() has returned that this credential is
ready to log on.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile handle of the user profile currently being
@param[in] User The user profile handle of the user profile currently being
considered by the user identity manager. If NULL, then no user
profile is currently under consideration.
@param[out] Identifier On return, points to the user identifier.
@param[out] Identifier On return, points to the user identifier.
@retval EFI_SUCCESS User identifier returned successfully.
@retval EFI_NOT_READY No user identifier can be returned.
@retval EFI_ACCESS_DENIED The user has been locked out of this user credential.
@retval EFI_INVALID_PARAMETER This is NULL, or Identifier is NULL.
@retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be
found in user profile database
**/
EFI_STATUS
EFIAPI
@@ -1000,19 +1000,19 @@ CredentialUser (
//
return EFI_NOT_READY;
}
if (User == NULL) {
//
// Return the user ID whose password matches the input password.
//
//
CopyMem (
Identifier,
&mPwdTable->UserInfo[mPwdTable->ValidIndex - 1].UserId,
Identifier,
&mPwdTable->UserInfo[mPwdTable->ValidIndex - 1].UserId,
sizeof (EFI_USER_INFO_IDENTIFIER)
);
);
return EFI_SUCCESS;
}
//
// Get the User's ID.
//
@@ -1024,7 +1024,7 @@ CredentialUser (
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
}
//
// Check whether the input password matches one in PwdTable.
//
@@ -1038,11 +1038,11 @@ CredentialUser (
CopyMem (Identifier, UserId, sizeof (EFI_USER_INFO_IDENTIFIER));
FreePool (UserInfo);
return EFI_SUCCESS;
}
}
}
}
FreePool (UserInfo);
FreePool (UserInfo);
return EFI_NOT_READY;
}
@@ -1050,17 +1050,17 @@ CredentialUser (
/**
Indicate that user interface interaction has begun for the specified credential.
This function is called when a credential provider is selected by the user. If
This function is called when a credential provider is selected by the user. If
AutoLogon returns FALSE, then the user interface will be constructed by the User
Identity Manager.
Identity Manager.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] AutoLogon On return, points to the credential provider's capabilities
after the credential provider has been selected by the user.
@param[out] AutoLogon On return, points to the credential provider's capabilities
after the credential provider has been selected by the user.
@retval EFI_SUCCESS Credential provider successfully selected.
@retval EFI_INVALID_PARAMETER AutoLogon is NULL.
**/
EFI_STATUS
EFIAPI
@@ -1084,9 +1084,9 @@ CredentialSelect (
This function is called when a credential provider is deselected by the user.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@retval EFI_SUCCESS Credential provider successfully deselected.
**/
EFI_STATUS
EFIAPI
@@ -1104,15 +1104,15 @@ CredentialDeselect (
/**
Return the default logon behavior for this user credential.
This function reports the default login behavior regarding this credential provider.
This function reports the default login behavior regarding this credential provider.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] AutoLogon On return, holds whether the credential provider should be used
by default to automatically log on the user.
by default to automatically log on the user.
@retval EFI_SUCCESS Default information successfully returned.
@retval EFI_INVALID_PARAMETER AutoLogon is NULL.
**/
EFI_STATUS
EFIAPI
@@ -1125,7 +1125,7 @@ CredentialDefault (
return EFI_INVALID_PARAMETER;
}
*AutoLogon = 0;
return EFI_SUCCESS;
}
@@ -1133,24 +1133,24 @@ CredentialDefault (
/**
Return information attached to the credential provider.
This function returns user information.
This function returns user information.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] UserInfo Handle of the user information data record.
@param[in] UserInfo Handle of the user information data record.
@param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On
exit, holds the user information. If the buffer is too small
to hold the information, then EFI_BUFFER_TOO_SMALL is returned
and InfoSize is updated to contain the number of bytes actually
required.
@param[in, out] InfoSize On entry, points to the size of Info. On return, points to the
size of the user information.
@param[in, out] InfoSize On entry, points to the size of Info. On return, points to the
size of the user information.
@retval EFI_SUCCESS Information returned successfully.
@retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the
user information. The size required is returned in *InfoSize.
@retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
@retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
@retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
**/
EFI_STATUS
EFIAPI
@@ -1163,7 +1163,7 @@ CredentialGetInfo (
{
EFI_USER_INFO *CredentialInfo;
UINTN Index;
if ((This == NULL) || (InfoSize == NULL) || (Info == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1171,7 +1171,7 @@ CredentialGetInfo (
if ((UserInfo == NULL) || (mPwdInfoHandle == NULL)) {
return EFI_NOT_FOUND;
}
//
// Find information handle in credential info table.
//
@@ -1185,11 +1185,11 @@ CredentialGetInfo (
*InfoSize = CredentialInfo->InfoSize;
return EFI_BUFFER_TOO_SMALL;
}
CopyMem (Info, CredentialInfo, CredentialInfo->InfoSize);
return EFI_SUCCESS;
CopyMem (Info, CredentialInfo, CredentialInfo->InfoSize);
return EFI_SUCCESS;
}
}
return EFI_NOT_FOUND;
}
@@ -1200,17 +1200,17 @@ CredentialGetInfo (
This function returns the next user information record. To retrieve the first user
information record handle, point UserInfo at a NULL. Each subsequent call will retrieve
another user information record handle until there are no more, at which point UserInfo
will point to NULL.
will point to NULL.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in, out] UserInfo On entry, points to the previous user information handle or NULL
to start enumeration. On exit, points to the next user information
handle or NULL if there is no more user information.
@retval EFI_SUCCESS User information returned.
@retval EFI_NOT_FOUND No more user information found.
@retval EFI_INVALID_PARAMETER UserInfo is NULL.
**/
EFI_STATUS
EFIAPI
@@ -1224,7 +1224,7 @@ CredentialGetNextInfo (
UINTN InfoLen;
UINTN Index;
UINTN ProvStrLen;
if ((This == NULL) || (UserInfo == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1246,13 +1246,13 @@ CredentialGetNextInfo (
InfoLen = sizeof (EFI_USER_INFO) + sizeof (EFI_GUID);
Info = AllocateZeroPool (InfoLen);
ASSERT (Info != NULL);
Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_RECORD;
Info->InfoSize = (UINT32) InfoLen;
Info->InfoAttribs = EFI_USER_INFO_PROTECTED;
CopyGuid (&Info->Credential, &gPwdCredentialProviderGuid);
CopyGuid ((EFI_GUID *)(Info + 1), &gPwdCredentialProviderGuid);
mPwdInfoHandle->Info[0] = Info;
mPwdInfoHandle->Count++;
@@ -1264,7 +1264,7 @@ CredentialGetNextInfo (
InfoLen = sizeof (EFI_USER_INFO) + ProvStrLen;
Info = AllocateZeroPool (InfoLen);
ASSERT (Info != NULL);
Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD;
Info->InfoSize = (UINT32) InfoLen;
Info->InfoAttribs = EFI_USER_INFO_PROTECTED;
@@ -1281,16 +1281,16 @@ CredentialGetNextInfo (
InfoLen = sizeof (EFI_USER_INFO) + sizeof (EFI_GUID);
Info = AllocateZeroPool (InfoLen);
ASSERT (Info != NULL);
Info->InfoType = EFI_USER_INFO_CREDENTIAL_TYPE_RECORD;
Info->InfoSize = (UINT32) InfoLen;
Info->InfoAttribs = EFI_USER_INFO_PROTECTED;
CopyGuid (&Info->Credential, &gPwdCredentialProviderGuid);
CopyGuid ((EFI_GUID *)(Info + 1), &gEfiUserCredentialClassPasswordGuid);
mPwdInfoHandle->Info[2] = Info;
mPwdInfoHandle->Count++;
//
// The fourth information, Credential Provider type name info.
//
@@ -1299,18 +1299,18 @@ CredentialGetNextInfo (
InfoLen = sizeof (EFI_USER_INFO) + ProvStrLen;
Info = AllocateZeroPool (InfoLen);
ASSERT (Info != NULL);
Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD;
Info->InfoSize = (UINT32) InfoLen;
Info->InfoAttribs = EFI_USER_INFO_PROTECTED;
CopyGuid (&Info->Credential, &gPwdCredentialProviderGuid);
CopyMem ((UINT8*)(Info + 1), ProvNameStr, ProvStrLen);
FreePool (ProvNameStr);
mPwdInfoHandle->Info[3] = Info;
mPwdInfoHandle->Count++;
}
if (*UserInfo == NULL) {
//
// Return the first info handle.
@@ -1318,7 +1318,7 @@ CredentialGetNextInfo (
*UserInfo = (EFI_USER_INFO_HANDLE) mPwdInfoHandle->Info[0];
return EFI_SUCCESS;
}
//
// Find information handle in credential info table.
//
@@ -1335,10 +1335,10 @@ CredentialGetNextInfo (
*UserInfo = NULL;
return EFI_NOT_FOUND;
}
Index++;
*UserInfo = (EFI_USER_INFO_HANDLE)mPwdInfoHandle->Info[Index];
return EFI_SUCCESS;
return EFI_SUCCESS;
}
}
@@ -1349,15 +1349,15 @@ CredentialGetNextInfo (
/**
Delete a user on this credential provider.
This function deletes a user on this credential provider.
This function deletes a user on this credential provider.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile handle to delete.
@retval EFI_SUCCESS User profile was successfully deleted.
@retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle.
Either the user profile cannot delete on any user profile or cannot delete
on a user profile other than the current user profile.
@retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle.
Either the user profile cannot delete on any user profile or cannot delete
on a user profile other than the current user profile.
@retval EFI_UNSUPPORTED This credential provider does not support deletion in the pre-OS.
@retval EFI_DEVICE_ERROR The new credential could not be deleted because of a device error.
@retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
@@ -1374,7 +1374,7 @@ CredentialDelete (
UINT8 *UserId;
UINT8 *NewUserId;
UINTN Index;
if ((This == NULL) || (User == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1394,7 +1394,7 @@ CredentialDelete (
//
// Find the user by user identifier in mPwdTable.
//
//
for (Index = 0; Index < mPwdTable->Count; Index++) {
UserId = (UINT8 *) &mPwdTable->UserInfo[Index].UserId;
NewUserId = (UINT8 *) (UserInfo + 1);
@@ -1442,7 +1442,7 @@ PasswordProviderInit (
if (EFI_ERROR (Status)) {
return Status;
}
//
// Init Form Browser.
//
@@ -1450,7 +1450,7 @@ PasswordProviderInit (
if (EFI_ERROR (Status)) {
return Status;
}
//
// Install protocol interfaces for the password credential provider.
//

View File

@@ -1,13 +1,13 @@
/** @file
Password Credential Provider driver header file.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -92,24 +92,24 @@ typedef struct {
/**
Enroll a user on a credential provider.
This function enrolls a user on this credential provider. If the user exists on
this credential provider, update the user information on this credential provider;
This function enrolls a user on this credential provider. If the user exists on
this credential provider, update the user information on this credential provider;
otherwise delete the user information on credential provider.
@param[in] This Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile to enroll.
@retval EFI_SUCCESS User profile was successfully enrolled.
@retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the
user profile handle. Either the user profile cannot enroll
on any user profile or cannot enroll on a user profile
on any user profile or cannot enroll on a user profile
other than the current user profile.
@retval EFI_UNSUPPORTED This credential provider does not support enrollment in
the pre-OS.
@retval EFI_DEVICE_ERROR The new credential could not be created because of a device
error.
@retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
**/
EFI_STATUS
EFIAPI
@@ -123,7 +123,7 @@ CredentialEnroll (
This function returns information about the form used when interacting with the
user during user identification. The form is the first enabled form in the form-set
class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
the user credential provider does not require a form to identify the user, then this
function should return EFI_NOT_FOUND.
@@ -131,13 +131,13 @@ CredentialEnroll (
@param[out] Hii On return, holds the HII database handle.
@param[out] FormSetId On return, holds the identifier of the form set which contains
the form used during user identification.
@param[out] FormId On return, holds the identifier of the form used during user
@param[out] FormId On return, holds the identifier of the form used during user
identification.
@retval EFI_SUCCESS Form returned successfully.
@retval EFI_NOT_FOUND Form not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL.
**/
EFI_STATUS
EFIAPI
@@ -153,22 +153,22 @@ CredentialForm (
This optional function returns a bitmap which is less than or equal to the number
of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND
is returned.
is returned.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in, out] Width On entry, points to the desired bitmap width. If NULL then no
bitmap information will be returned. On exit, points to the
@param[in, out] Width On entry, points to the desired bitmap width. If NULL then no
bitmap information will be returned. On exit, points to the
width of the bitmap returned.
@param[in, out] Height On entry, points to the desired bitmap height. If NULL then no
bitmap information will be returned. On exit, points to the
bitmap information will be returned. On exit, points to the
height of the bitmap returned
@param[out] Hii On return, holds the HII database handle.
@param[out] Image On return, holds the HII image identifier.
@param[out] Hii On return, holds the HII database handle.
@param[out] Image On return, holds the HII image identifier.
@retval EFI_SUCCESS Image identifier returned successfully.
@retval EFI_NOT_FOUND Image identifier not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL.
**/
EFI_STATUS
EFIAPI
@@ -184,16 +184,16 @@ CredentialTile (
Returns string used to describe the credential provider type.
This function returns a string which describes the credential provider. If no
such string exists, then EFI_NOT_FOUND is returned.
such string exists, then EFI_NOT_FOUND is returned.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] Hii On return, holds the HII database handle.
@param[out] String On return, holds the HII string identifier.
@retval EFI_SUCCESS String identifier returned successfully.
@retval EFI_NOT_FOUND String identifier not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL.
**/
EFI_STATUS
EFIAPI
@@ -207,23 +207,23 @@ CredentialTitle (
Return the user identifier associated with the currently authenticated user.
This function returns the user identifier of the user authenticated by this credential
provider. This function is called after the credential-related information has been
provider. This function is called after the credential-related information has been
submitted on a form OR after a call to Default() has returned that this credential is
ready to log on.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile handle of the user profile currently being
@param[in] User The user profile handle of the user profile currently being
considered by the user identity manager. If NULL, then no user
profile is currently under consideration.
@param[out] Identifier On return, points to the user identifier.
@param[out] Identifier On return, points to the user identifier.
@retval EFI_SUCCESS User identifier returned successfully.
@retval EFI_NOT_READY No user identifier can be returned.
@retval EFI_ACCESS_DENIED The user has been locked out of this user credential.
@retval EFI_INVALID_PARAMETER This is NULL, or Identifier is NULL.
@retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be
found in user profile database
**/
EFI_STATUS
EFIAPI
@@ -236,17 +236,17 @@ CredentialUser (
/**
Indicate that user interface interaction has begun for the specified credential.
This function is called when a credential provider is selected by the user. If
This function is called when a credential provider is selected by the user. If
AutoLogon returns FALSE, then the user interface will be constructed by the User
Identity Manager.
Identity Manager.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] AutoLogon On return, points to the credential provider's capabilities
after the credential provider has been selected by the user.
@param[out] AutoLogon On return, points to the credential provider's capabilities
after the credential provider has been selected by the user.
@retval EFI_SUCCESS Credential provider successfully selected.
@retval EFI_INVALID_PARAMETER AutoLogon is NULL.
**/
EFI_STATUS
EFIAPI
@@ -261,9 +261,9 @@ CredentialSelect (
This function is called when a credential provider is deselected by the user.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@retval EFI_SUCCESS Credential provider successfully deselected.
**/
EFI_STATUS
EFIAPI
@@ -274,12 +274,12 @@ CredentialDeselect (
/**
Return the default logon behavior for this user credential.
This function reports the default login behavior regarding this credential provider.
This function reports the default login behavior regarding this credential provider.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] AutoLogon On return, holds whether the credential provider should be used
by default to automatically log on the user.
by default to automatically log on the user.
@retval EFI_SUCCESS Default information successfully returned.
@retval EFI_INVALID_PARAMETER AutoLogon is NULL.
@@ -294,24 +294,24 @@ CredentialDefault (
/**
Return information attached to the credential provider.
This function returns user information.
This function returns user information.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] UserInfo Handle of the user information data record.
@param[in] UserInfo Handle of the user information data record.
@param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On
exit, holds the user information. If the buffer is too small
to hold the information, then EFI_BUFFER_TOO_SMALL is returned
and InfoSize is updated to contain the number of bytes actually
required.
@param[in, out] InfoSize On entry, points to the size of Info. On return, points to the
size of the user information.
@param[in, out] InfoSize On entry, points to the size of Info. On return, points to the
size of the user information.
@retval EFI_SUCCESS Information returned successfully.
@retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the
user information. The size required is returned in *InfoSize.
@retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
@retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
@retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
**/
EFI_STATUS
EFIAPI
@@ -329,17 +329,17 @@ CredentialGetInfo (
This function returns the next user information record. To retrieve the first user
information record handle, point UserInfo at a NULL. Each subsequent call will retrieve
another user information record handle until there are no more, at which point UserInfo
will point to NULL.
will point to NULL.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in, out] UserInfo On entry, points to the previous user information handle or NULL
to start enumeration. On exit, points to the next user information
handle or NULL if there is no more user information.
@retval EFI_SUCCESS User information returned.
@retval EFI_NOT_FOUND No more user information found.
@retval EFI_INVALID_PARAMETER UserInfo is NULL.
**/
EFI_STATUS
EFIAPI
@@ -351,15 +351,15 @@ CredentialGetNextInfo (
/**
Delete a user on this credential provider.
This function deletes a user on this credential provider.
This function deletes a user on this credential provider.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile handle to delete.
@retval EFI_SUCCESS User profile was successfully deleted.
@retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle.
Either the user profile cannot delete on any user profile or cannot delete
on a user profile other than the current user profile.
@retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle.
Either the user profile cannot delete on any user profile or cannot delete
on a user profile other than the current user profile.
@retval EFI_UNSUPPORTED This credential provider does not support deletion in the pre-OS.
@retval EFI_DEVICE_ERROR The new credential could not be deleted because of a device error.
@retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.

View File

@@ -1,13 +1,13 @@
/** @file
Data structure used by the Password Credential Provider driver.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -24,7 +24,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Key defination
//
//
#define KEY_GET_PASSWORD 0x1000
#endif

View File

@@ -2,7 +2,7 @@
# Provides a password credential provider implementation
# This module provides a password credential provider implementation.
#
# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -44,22 +44,22 @@
HiiLib
UefiLib
BaseCryptLib
[Guids]
gEfiUserCredentialClassPasswordGuid ## SOMETIMES_CONSUMES ## GUID
## PRODUCES ## Variable:L"PwdCredential"
## CONSUMES ## Variable:L"PwdCredential"
## CONSUMES ## HII
## SOMETIMES_CONSUMES ## GUID # The credential provider identifier
gPwdCredentialProviderGuid
[Protocols]
gEfiDevicePathProtocolGuid ## PRODUCES
gEfiHiiConfigAccessProtocolGuid ## PRODUCES
gEfiUserCredential2ProtocolGuid ## PRODUCES
gEfiUserManagerProtocolGuid ## SOMETIMES_CONSUMES
[UserExtensions.TianoCore."ExtraFiles"]
PwdCredentialProviderExtra.uni

View File

@@ -1,7 +1,7 @@
// /** @file
// PwdCredentialProvider Localized Strings and Content
//
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -12,8 +12,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"Password Credential Provider"

View File

@@ -1,7 +1,7 @@
/** @file
String definitions for the Password Credential Provider.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -15,20 +15,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#langdef en-US "English"
#langdef fr-FR "Francais"
#string STR_CREDENTIAL_TITLE #language en-US "Password Credential Provider"
#string STR_CREDENTIAL_TITLE #language en-US "Password Credential Provider"
#language fr-FR "Password Credential Provider (French)"
#string STR_FORM_TITLE #language en-US "Get Password"
#language fr-FR "Get Password(French)"
#string STR_FORM_TITLE #language en-US "Get Password"
#language fr-FR "Get Password(French)"
#string STR_NULL_STRING #language en-US ""
#language fr-FR ""
#string STR_INPUT_PASSWORD #language en-US "Please Input Password"
#language fr-FR "Please Input Password(French)"
#string STR_PROVIDER_NAME #language en-US "INTEL Password Credential Provider"
#string STR_INPUT_PASSWORD #language en-US "Please Input Password"
#language fr-FR "Please Input Password(French)"
#string STR_PROVIDER_NAME #language en-US "INTEL Password Credential Provider"
#language fr-FR "INTEL Password Credential Provider(French)"
#string STR_PROVIDER_TYPE_NAME #language en-US "Password Credential Provider"
#language fr-FR "Password Credential Provider(French)"
#language fr-FR "Password Credential Provider(French)"
#string STR_INPUT_PASSWORD_AGAIN #language en-US "Input Password Again"
#language fr-FR "Input Password Again (French)"
#language fr-FR "Input Password Again (French)"
#string STR_DRAW_A_LINE #language en-US "-----------------------------"
#language fr-FR "------------------------------------"
#string STR_PASSWORD_INCORRECT #language en-US " Incorrect Password! "

View File

@@ -1,13 +1,13 @@
/** @file
Usb Credential Provider driver implemenetation.
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -78,7 +78,7 @@ ExpandTableSize (
sizeof (CREDENTIAL_TABLE) - sizeof (USB_INFO) +
Count * sizeof (USB_INFO)
);
ASSERT (NewTable != NULL);
ASSERT (NewTable != NULL);
NewTable->MaxCount = Count;
NewTable->Count = mUsbTable->Count;
@@ -87,8 +87,8 @@ ExpandTableSize (
// Copy old entries.
//
CopyMem (
&NewTable->UserInfo,
&mUsbTable->UserInfo,
&NewTable->UserInfo,
&mUsbTable->UserInfo,
mUsbTable->Count * sizeof (USB_INFO)
);
FreePool (mUsbTable);
@@ -100,8 +100,8 @@ ExpandTableSize (
Add, update or delete info in table, and sync with NV variable.
@param[in] Index The index of the password in table. If index is found in
table, update the info, else add the into to table.
@param[in] Info The new credential info to add into table. If Info is NULL,
table, update the info, else add the into to table.
@param[in] Info The new credential info to add into table. If Info is NULL,
delete the info by Index.
@retval EFI_INVALID_PARAMETER Info is NULL when save the info.
@@ -117,7 +117,7 @@ ModifyTable (
{
EFI_STATUS Status;
USB_INFO *NewUsbInfo;
NewUsbInfo = NULL;
if (Index < mUsbTable->Count) {
if (Info == NULL) {
@@ -127,7 +127,7 @@ ModifyTable (
mUsbTable->Count--;
if (Index != mUsbTable->Count) {
NewUsbInfo = &mUsbTable->UserInfo[mUsbTable->Count];
}
}
} else {
//
// Update the specified entry.
@@ -190,9 +190,9 @@ InitCredentialTable (
VarSize = 0;
Var = NULL;
Status = gRT->GetVariable (
L"UsbCredential",
&gUsbCredentialProviderGuid,
NULL,
L"UsbCredential",
&gUsbCredentialProviderGuid,
NULL,
&VarSize,
Var
);
@@ -202,9 +202,9 @@ InitCredentialTable (
return EFI_OUT_OF_RESOURCES;
}
Status = gRT->GetVariable (
L"UsbCredential",
&gUsbCredentialProviderGuid,
NULL,
L"UsbCredential",
&gUsbCredentialProviderGuid,
NULL,
&VarSize,
Var
);
@@ -212,13 +212,13 @@ InitCredentialTable (
if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
return Status;
}
//
// Init Usb credential table.
//
mUsbTable = AllocateZeroPool (
sizeof (CREDENTIAL_TABLE) - sizeof (USB_INFO) +
USB_TABLE_INC * sizeof (USB_INFO) +
USB_TABLE_INC * sizeof (USB_INFO) +
VarSize
);
if (mUsbTable == NULL) {
@@ -306,7 +306,7 @@ GetFileData (
if (EFI_ERROR (Status)) {
continue;
}
Status = SimpleFileSystem->OpenVolume (
SimpleFileSystem,
&RootFs
@@ -314,7 +314,7 @@ GetFileData (
if (EFI_ERROR (Status)) {
continue;
}
Status = RootFs->Open (
RootFs,
&FileHandle,
@@ -324,7 +324,7 @@ GetFileData (
);
if (!EFI_ERROR (Status)) {
break;
}
}
}
}
@@ -335,7 +335,7 @@ GetFileData (
Status = EFI_NOT_FOUND;
goto Done;
}
//
// Figure out how big the file is.
//
@@ -352,7 +352,7 @@ GetFileData (
goto Done;
}
FileInfo = AllocateZeroPool (ScratchBufferSize);
FileInfo = AllocateZeroPool (ScratchBufferSize);
if (FileInfo == NULL) {
DEBUG ((DEBUG_ERROR, "Can not allocate enough memory for the token file!\n"));
Status = EFI_OUT_OF_RESOURCES;
@@ -370,18 +370,18 @@ GetFileData (
Status = EFI_DEVICE_ERROR;
goto Done;
}
//
// Allocate a buffer for the file.
//
*BufferSize = (UINT32) FileInfo->FileSize;
*Buffer = AllocateZeroPool (*BufferSize);
*Buffer = AllocateZeroPool (*BufferSize);
if (*Buffer == NULL) {
DEBUG ((DEBUG_ERROR, "Can not allocate a buffer for the file!\n"));
Status = EFI_OUT_OF_RESOURCES;
goto Done;
}
//
// Load file into the allocated memory.
//
@@ -392,7 +392,7 @@ GetFileData (
Status = EFI_DEVICE_ERROR;
goto Done;
}
//
// Close file.
//
@@ -416,13 +416,13 @@ Done:
/**
Hash the data to get credential.
@param[in] Buffer Points to the data buffer
@param[in] Buffer Points to the data buffer
@param[in] BufferSize The size of data in buffer, in bytes.
@param[out] Credential Points to the hashed result
@retval TRUE Hash the data successfully.
@retval FALSE Failed to hash the data.
**/
BOOLEAN
GenerateCredential (
@@ -434,23 +434,23 @@ GenerateCredential (
BOOLEAN Status;
UINTN HashSize;
VOID *Hash;
HashSize = Sha1GetContextSize ();
Hash = AllocatePool (HashSize);
ASSERT (Hash != NULL);
Status = Sha1Init (Hash);
if (!Status) {
goto Done;
}
Status = Sha1Update (Hash, Buffer, BufferSize);
if (!Status) {
goto Done;
}
Status = Sha1Final (Hash, Credential);
Done:
FreePool (Hash);
return Status;
@@ -464,7 +464,7 @@ Done:
@retval EFI_SUCCESS Read a Token successfully.
@retval Others Fails to read a Token.
**/
EFI_STATUS
GetToken (
@@ -484,14 +484,14 @@ GetToken (
DEBUG ((DEBUG_ERROR, "Read file %s from USB error! Status=(%r)\n", TokenFile, Status));
return Status;
}
if (!GenerateCredential (Buffer, BufSize, Token)) {
DEBUG ((DEBUG_ERROR, "Generate credential from read data failed!\n"));
FreePool (Buffer);
return EFI_SECURITY_VIOLATION;
}
FreePool (Buffer);
FreePool (Buffer);
return EFI_SUCCESS;
}
@@ -499,16 +499,16 @@ GetToken (
/**
Find a user infomation record by the information record type.
This function searches all user information records of User from beginning
This function searches all user information records of User from beginning
until either the information is found or there are no more user infomation
record. A match occurs when a Info.InfoType field matches the user information
record type.
@param[in] User Points to the user profile record to search.
@param[in] User Points to the user profile record to search.
@param[in] InfoType The infomation type to be searched.
@param[out] Info Points to the user info found, the caller is responsible
to free.
@retval EFI_SUCCESS Find the user information successfully.
@retval Others Fail to find the user information.
@@ -525,7 +525,7 @@ FindUserInfoByType (
UINTN UserInfoSize;
EFI_USER_INFO_HANDLE UserInfoHandle;
EFI_USER_MANAGER_PROTOCOL *UserManager;
//
// Find user information by information type.
//
@@ -588,7 +588,7 @@ FindUserInfoByType (
if (UserInfo->InfoType == InfoType) {
*Info = UserInfo;
return EFI_SUCCESS;
}
}
}
if (UserInfo != NULL) {
@@ -611,7 +611,7 @@ InitFormBrowser (
)
{
USB_PROVIDER_CALLBACK_INFO *CallbackInfo;
//
// Initialize driver private data.
//
@@ -619,7 +619,7 @@ InitFormBrowser (
if (CallbackInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
}
CallbackInfo->DriverHandle = NULL;
//
@@ -643,24 +643,24 @@ InitFormBrowser (
/**
Enroll a user on a credential provider.
This function enrolls a user on this credential provider. If the user exists on
this credential provider, update the user information on this credential provider;
This function enrolls a user on this credential provider. If the user exists on
this credential provider, update the user information on this credential provider;
otherwise add the user information on credential provider.
@param[in] This Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile to enroll.
@retval EFI_SUCCESS User profile was successfully enrolled.
@retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the
user profile handle. Either the user profile cannot enroll
on any user profile or cannot enroll on a user profile
on any user profile or cannot enroll on a user profile
other than the current user profile.
@retval EFI_UNSUPPORTED This credential provider does not support enrollment in
the pre-OS.
@retval EFI_DEVICE_ERROR The new credential could not be created because of a device
error.
@retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
**/
EFI_STATUS
EFIAPI
@@ -681,7 +681,7 @@ CredentialEnroll (
if ((This == NULL) || (User == NULL)) {
return EFI_INVALID_PARAMETER;
}
//
// Get User Identifier
//
@@ -695,16 +695,16 @@ CredentialEnroll (
return EFI_INVALID_PARAMETER;
}
CopyMem (UsbInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER));
CopyMem (UsbInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER));
FreePool (UserInfo);
//
// Get Token and User ID to UsbInfo.
//
Status = GetToken (UsbInfo.Token);
if (EFI_ERROR (Status)) {
QuestionStr = GetStringById (STRING_TOKEN (STR_READ_USB_TOKEN_ERROR));
PromptStr = GetStringById (STRING_TOKEN (STR_INSERT_USB_TOKEN));
PromptStr = GetStringById (STRING_TOKEN (STR_INSERT_USB_TOKEN));
CreatePopUp (
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
&Key,
@@ -716,21 +716,21 @@ CredentialEnroll (
FreePool (QuestionStr);
FreePool (PromptStr);
return Status;
}
}
//
// Check whether User is ever enrolled in the provider.
//
//
for (Index = 0; Index < mUsbTable->Count; Index++) {
UserId = (UINT8 *) &mUsbTable->UserInfo[Index].UserId;
if (CompareMem (UserId, (UINT8 *) &UsbInfo.UserId, sizeof (EFI_USER_INFO_IDENTIFIER)) == 0) {
//
// User already exists, update the password.
//
//
break;
}
}
//
// Enroll the User to the provider.
//
@@ -748,7 +748,7 @@ CredentialEnroll (
This function returns information about the form used when interacting with the
user during user identification. The form is the first enabled form in the form-set
class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
the user credential provider does not require a form to identify the user, then this
function should return EFI_NOT_FOUND.
@@ -756,13 +756,13 @@ CredentialEnroll (
@param[out] Hii On return, holds the HII database handle.
@param[out] FormSetId On return, holds the identifier of the form set which contains
the form used during user identification.
@param[out] FormId On return, holds the identifier of the form used during user
@param[out] FormId On return, holds the identifier of the form used during user
identification.
@retval EFI_SUCCESS Form returned successfully.
@retval EFI_NOT_FOUND Form not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL.
**/
EFI_STATUS
EFIAPI
@@ -773,7 +773,7 @@ CredentialForm (
OUT EFI_FORM_ID *FormId
)
{
if ((This == NULL) || (Hii == NULL) ||
if ((This == NULL) || (Hii == NULL) ||
(FormSetId == NULL) || (FormId == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -786,22 +786,22 @@ CredentialForm (
This optional function returns a bitmap which is less than or equal to the number
of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND
is returned.
is returned.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in, out] Width On entry, points to the desired bitmap width. If NULL then no
bitmap information will be returned. On exit, points to the
@param[in, out] Width On entry, points to the desired bitmap width. If NULL then no
bitmap information will be returned. On exit, points to the
width of the bitmap returned.
@param[in, out] Height On entry, points to the desired bitmap height. If NULL then no
bitmap information will be returned. On exit, points to the
bitmap information will be returned. On exit, points to the
height of the bitmap returned.
@param[out] Hii On return, holds the HII database handle.
@param[out] Image On return, holds the HII image identifier.
@param[out] Hii On return, holds the HII database handle.
@param[out] Image On return, holds the HII image identifier.
@retval EFI_SUCCESS Image identifier returned successfully.
@retval EFI_NOT_FOUND Image identifier not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL.
**/
EFI_STATUS
EFIAPI
@@ -824,16 +824,16 @@ CredentialTile (
Returns string used to describe the credential provider type.
This function returns a string which describes the credential provider. If no
such string exists, then EFI_NOT_FOUND is returned.
such string exists, then EFI_NOT_FOUND is returned.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] Hii On return, holds the HII database handle.
@param[out] String On return, holds the HII string identifier.
@retval EFI_SUCCESS String identifier returned successfully.
@retval EFI_NOT_FOUND String identifier not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL.
**/
EFI_STATUS
EFIAPI
@@ -860,23 +860,23 @@ CredentialTitle (
Return the user identifier associated with the currently authenticated user.
This function returns the user identifier of the user authenticated by this credential
provider. This function is called after the credential-related information has been
provider. This function is called after the credential-related information has been
submitted on a form OR after a call to Default() has returned that this credential is
ready to log on.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile handle of the user profile currently being
@param[in] User The user profile handle of the user profile currently being
considered by the user identity manager. If NULL, then no user
profile is currently under consideration.
@param[out] Identifier On return, points to the user identifier.
@param[out] Identifier On return, points to the user identifier.
@retval EFI_SUCCESS User identifier returned successfully.
@retval EFI_NOT_READY No user identifier can be returned.
@retval EFI_ACCESS_DENIED The user has been locked out of this user credential.
@retval EFI_INVALID_PARAMETER This is NULL, or Identifier is NULL.
@retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be
found in user profile database.
**/
EFI_STATUS
EFIAPI
@@ -891,16 +891,16 @@ CredentialUser (
EFI_USER_INFO *UserInfo;
UINT8 *UserId;
UINT8 *NewUserId;
UINT8 *UserToken;
UINT8 *UserToken;
UINT8 ReadToken[HASHED_CREDENTIAL_LEN];
EFI_INPUT_KEY Key;
CHAR16 *QuestionStr;
CHAR16 *PromptStr;
if ((This == NULL) || (Identifier == NULL)) {
return EFI_INVALID_PARAMETER;
}
if (User == NULL) {
//
// Verify the auto logon user, get user id by matched token.
@@ -908,7 +908,7 @@ CredentialUser (
if (mUsbTable->Count == 0) {
return EFI_NOT_READY;
}
//
// No user selected, get token first and verify the user existed in user database.
//
@@ -916,7 +916,7 @@ CredentialUser (
if (EFI_ERROR (Status)) {
return EFI_NOT_READY;
}
for (Index = 0; Index < mUsbTable->Count; Index++) {
//
// find the specified credential in the Usb credential database.
@@ -929,15 +929,15 @@ CredentialUser (
}
}
return EFI_NOT_READY;
return EFI_NOT_READY;
}
//
// User is not NULL here. Read a token, and check whether the token matches with
// the selected user's Token. If not, try to find a token in token DB to matches
//
// User is not NULL here. Read a token, and check whether the token matches with
// the selected user's Token. If not, try to find a token in token DB to matches
// with read token.
//
//
Status = GetToken (ReadToken);
if (EFI_ERROR (Status)) {
QuestionStr = GetStringById (STRING_TOKEN (STR_READ_USB_TOKEN_ERROR));
@@ -961,8 +961,8 @@ CredentialUser (
Status = FindUserInfoByType (User, EFI_USER_INFO_IDENTIFIER_RECORD, &UserInfo);
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
}
}
//
// Check the selected user's Token with the read token.
//
@@ -981,12 +981,12 @@ CredentialUser (
CopyMem (Identifier, UserId, sizeof (EFI_USER_INFO_IDENTIFIER));
FreePool (UserInfo);
return EFI_SUCCESS;
}
}
}
}
FreePool (UserInfo);
FreePool (UserInfo);
return EFI_NOT_READY;
}
@@ -994,17 +994,17 @@ CredentialUser (
/**
Indicate that user interface interaction has begun for the specified credential.
This function is called when a credential provider is selected by the user. If
This function is called when a credential provider is selected by the user. If
AutoLogon returns FALSE, then the user interface will be constructed by the User
Identity Manager.
Identity Manager.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] AutoLogon On return, points to the credential provider's capabilities
after the credential provider has been selected by the user.
@param[out] AutoLogon On return, points to the credential provider's capabilities
after the credential provider has been selected by the user.
@retval EFI_SUCCESS Credential provider successfully selected.
@retval EFI_INVALID_PARAMETER AutoLogon is NULL.
**/
EFI_STATUS
EFIAPI
@@ -1029,9 +1029,9 @@ CredentialSelect (
This function is called when a credential provider is deselected by the user.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@retval EFI_SUCCESS Credential provider successfully deselected.
**/
EFI_STATUS
EFIAPI
@@ -1049,15 +1049,15 @@ CredentialDeselect (
/**
Return the default logon behavior for this user credential.
This function reports the default login behavior regarding this credential provider.
This function reports the default login behavior regarding this credential provider.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] AutoLogon On return, holds whether the credential provider should be used
by default to automatically log on the user.
by default to automatically log on the user.
@retval EFI_SUCCESS Default information successfully returned.
@retval EFI_INVALID_PARAMETER AutoLogon is NULL.
**/
EFI_STATUS
EFIAPI
@@ -1078,24 +1078,24 @@ CredentialDefault (
/**
Return information attached to the credential provider.
This function returns user information.
This function returns user information.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] UserInfo Handle of the user information data record.
@param[in] UserInfo Handle of the user information data record.
@param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On
exit, holds the user information. If the buffer is too small
to hold the information, then EFI_BUFFER_TOO_SMALL is returned
and InfoSize is updated to contain the number of bytes actually
required.
@param[in, out] InfoSize On entry, points to the size of Info. On return, points to the
size of the user information.
@param[in, out] InfoSize On entry, points to the size of Info. On return, points to the
size of the user information.
@retval EFI_SUCCESS Information returned successfully.
@retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the
user information. The size required is returned in *InfoSize.
@retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
@retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
@retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
**/
EFI_STATUS
EFIAPI
@@ -1108,7 +1108,7 @@ CredentialGetInfo (
{
EFI_USER_INFO *CredentialInfo;
UINTN Index;
if ((This == NULL) || (InfoSize == NULL) || (Info == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1116,7 +1116,7 @@ CredentialGetInfo (
if ((UserInfo == NULL) || (mUsbInfoHandle == NULL)) {
return EFI_NOT_FOUND;
}
//
// Find information handle in credential info table.
//
@@ -1130,12 +1130,12 @@ CredentialGetInfo (
*InfoSize = CredentialInfo->InfoSize;
return EFI_BUFFER_TOO_SMALL;
}
CopyMem (Info, CredentialInfo, CredentialInfo->InfoSize);
return EFI_SUCCESS;
CopyMem (Info, CredentialInfo, CredentialInfo->InfoSize);
return EFI_SUCCESS;
}
}
return EFI_NOT_FOUND;
}
@@ -1146,17 +1146,17 @@ CredentialGetInfo (
This function returns the next user information record. To retrieve the first user
information record handle, point UserInfo at a NULL. Each subsequent call will retrieve
another user information record handle until there are no more, at which point UserInfo
will point to NULL.
will point to NULL.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in, out] UserInfo On entry, points to the previous user information handle or NULL
to start enumeration. On exit, points to the next user information
handle or NULL if there is no more user information.
@retval EFI_SUCCESS User information returned.
@retval EFI_NOT_FOUND No more user information found.
@retval EFI_INVALID_PARAMETER UserInfo is NULL.
**/
EFI_STATUS
EFIAPI
@@ -1170,7 +1170,7 @@ CredentialGetNextInfo (
UINTN InfoLen;
UINTN Index;
UINTN ProvStrLen;
if ((This == NULL) || (UserInfo == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1192,13 +1192,13 @@ CredentialGetNextInfo (
InfoLen = sizeof (EFI_USER_INFO) + sizeof (EFI_GUID);
Info = AllocateZeroPool (InfoLen);
ASSERT (Info != NULL);
Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_RECORD;
Info->InfoSize = (UINT32) InfoLen;
Info->InfoAttribs = EFI_USER_INFO_PROTECTED;
CopyGuid (&Info->Credential, &gUsbCredentialProviderGuid);
CopyGuid ((EFI_GUID *)(Info + 1), &gUsbCredentialProviderGuid);
mUsbInfoHandle->Info[0] = Info;
mUsbInfoHandle->Count++;
@@ -1210,14 +1210,14 @@ CredentialGetNextInfo (
InfoLen = sizeof (EFI_USER_INFO) + ProvStrLen;
Info = AllocateZeroPool (InfoLen);
ASSERT (Info != NULL);
Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD;
Info->InfoSize = (UINT32) InfoLen;
Info->InfoAttribs = EFI_USER_INFO_PROTECTED;
CopyGuid (&Info->Credential, &gUsbCredentialProviderGuid);
CopyMem ((UINT8*)(Info + 1), ProvNameStr, ProvStrLen);
FreePool (ProvNameStr);
mUsbInfoHandle->Info[1] = Info;
mUsbInfoHandle->Count++;
@@ -1227,16 +1227,16 @@ CredentialGetNextInfo (
InfoLen = sizeof (EFI_USER_INFO) + sizeof (EFI_GUID);
Info = AllocateZeroPool (InfoLen);
ASSERT (Info != NULL);
Info->InfoType = EFI_USER_INFO_CREDENTIAL_TYPE_RECORD;
Info->InfoSize = (UINT32) InfoLen;
Info->InfoAttribs = EFI_USER_INFO_PROTECTED;
CopyGuid (&Info->Credential, &gUsbCredentialProviderGuid);
CopyGuid ((EFI_GUID *)(Info + 1), &gEfiUserCredentialClassSecureCardGuid);
mUsbInfoHandle->Info[2] = Info;
mUsbInfoHandle->Count++;
//
// The fourth information, Credential Provider type name info.
//
@@ -1245,18 +1245,18 @@ CredentialGetNextInfo (
InfoLen = sizeof (EFI_USER_INFO) + ProvStrLen;
Info = AllocateZeroPool (InfoLen);
ASSERT (Info != NULL);
Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD;
Info->InfoSize = (UINT32) InfoLen;
Info->InfoAttribs = EFI_USER_INFO_PROTECTED;
CopyGuid (&Info->Credential, &gUsbCredentialProviderGuid);
CopyMem ((UINT8*)(Info + 1), ProvNameStr, ProvStrLen);
FreePool (ProvNameStr);
mUsbInfoHandle->Info[3] = Info;
mUsbInfoHandle->Count++;
}
if (*UserInfo == NULL) {
//
// Return the first info handle.
@@ -1264,7 +1264,7 @@ CredentialGetNextInfo (
*UserInfo = (EFI_USER_INFO_HANDLE) mUsbInfoHandle->Info[0];
return EFI_SUCCESS;
}
//
// Find information handle in credential info table.
//
@@ -1283,7 +1283,7 @@ CredentialGetNextInfo (
}
Index++;
*UserInfo = (EFI_USER_INFO_HANDLE)mUsbInfoHandle->Info[Index];
return EFI_SUCCESS;
return EFI_SUCCESS;
}
}
@@ -1295,15 +1295,15 @@ CredentialGetNextInfo (
/**
Delete a user on this credential provider.
This function deletes a user on this credential provider.
This function deletes a user on this credential provider.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile handle to delete.
@retval EFI_SUCCESS User profile was successfully deleted.
@retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle.
Either the user profile cannot delete on any user profile or cannot delete
on a user profile other than the current user profile.
@retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle.
Either the user profile cannot delete on any user profile or cannot delete
on a user profile other than the current user profile.
@retval EFI_UNSUPPORTED This credential provider does not support deletion in the pre-OS.
@retval EFI_DEVICE_ERROR The new credential could not be deleted because of a device error.
@retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
@@ -1320,7 +1320,7 @@ CredentialDelete (
UINT8 *UserId;
UINT8 *NewUserId;
UINTN Index;
if ((This == NULL) || (User == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1340,7 +1340,7 @@ CredentialDelete (
//
// Find the user by user identifier in mPwdTable.
//
//
for (Index = 0; Index < mUsbTable->Count; Index++) {
UserId = (UINT8 *) &mUsbTable->UserInfo[Index].UserId;
NewUserId = (UINT8 *) (UserInfo + 1);
@@ -1388,7 +1388,7 @@ UsbProviderInit (
if (EFI_ERROR (Status)) {
return Status;
}
//
// Init Form Browser
//
@@ -1396,7 +1396,7 @@ UsbProviderInit (
if (EFI_ERROR (Status)) {
return Status;
}
//
// Install protocol interfaces for the Usb Credential Provider.
//

View File

@@ -1,13 +1,13 @@
/** @file
Usb Credential Provider driver header file.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -80,26 +80,26 @@ typedef struct {
/**
Enroll a user on a credential provider.
This function enrolls and deletes a user profile using this credential provider.
If a user profile is successfully enrolled, it calls the User Manager Protocol
function Notify() to notify the user manager driver that credential information
has changed. If an enrolled user does exist, delete the user on the credential
This function enrolls and deletes a user profile using this credential provider.
If a user profile is successfully enrolled, it calls the User Manager Protocol
function Notify() to notify the user manager driver that credential information
has changed. If an enrolled user does exist, delete the user on the credential
provider.
@param[in] This Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile to enroll.
@retval EFI_SUCCESS User profile was successfully enrolled.
@retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the
user profile handle. Either the user profile cannot enroll
on any user profile or cannot enroll on a user profile
on any user profile or cannot enroll on a user profile
other than the current user profile.
@retval EFI_UNSUPPORTED This credential provider does not support enrollment in
the pre-OS.
@retval EFI_DEVICE_ERROR The new credential could not be created because of a device
error.
@retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
**/
EFI_STATUS
EFIAPI
@@ -111,21 +111,21 @@ CredentialEnroll (
/**
Returns the user interface information used during user identification.
This function enrolls a user on this credential provider. If the user exists on
this credential provider, update the user information on this credential provider;
This function enrolls a user on this credential provider. If the user exists on
this credential provider, update the user information on this credential provider;
otherwise delete the user information on credential provider.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] Hii On return, holds the HII database handle.
@param[out] FormSetId On return, holds the identifier of the form set which contains
the form used during user identification.
@param[out] FormId On return, holds the identifier of the form used during user
@param[out] FormId On return, holds the identifier of the form used during user
identification.
@retval EFI_SUCCESS Form returned successfully.
@retval EFI_NOT_FOUND Form not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL.
**/
EFI_STATUS
EFIAPI
@@ -141,22 +141,22 @@ CredentialForm (
This optional function returns a bitmap which is less than or equal to the number
of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND
is returned.
is returned.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in, out] Width On entry, points to the desired bitmap width. If NULL then no
bitmap information will be returned. On exit, points to the
@param[in, out] Width On entry, points to the desired bitmap width. If NULL then no
bitmap information will be returned. On exit, points to the
width of the bitmap returned.
@param[in, out] Height On entry, points to the desired bitmap height. If NULL then no
bitmap information will be returned. On exit, points to the
bitmap information will be returned. On exit, points to the
height of the bitmap returned.
@param[out] Hii On return, holds the HII database handle.
@param[out] Image On return, holds the HII image identifier.
@param[out] Hii On return, holds the HII database handle.
@param[out] Image On return, holds the HII image identifier.
@retval EFI_SUCCESS Image identifier returned successfully.
@retval EFI_NOT_FOUND Image identifier not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL.
**/
EFI_STATUS
EFIAPI
@@ -172,16 +172,16 @@ CredentialTile (
Returns string used to describe the credential provider type.
This function returns a string which describes the credential provider. If no
such string exists, then EFI_NOT_FOUND is returned.
such string exists, then EFI_NOT_FOUND is returned.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] Hii On return, holds the HII database handle.
@param[out] String On return, holds the HII string identifier.
@retval EFI_SUCCESS String identifier returned successfully.
@retval EFI_NOT_FOUND String identifier not returned.
@retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL.
**/
EFI_STATUS
EFIAPI
@@ -195,23 +195,23 @@ CredentialTitle (
Return the user identifier associated with the currently authenticated user.
This function returns the user identifier of the user authenticated by this credential
provider. This function is called after the credential-related information has been
provider. This function is called after the credential-related information has been
submitted on a form OR after a call to Default() has returned that this credential is
ready to log on.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile handle of the user profile currently being
@param[in] User The user profile handle of the user profile currently being
considered by the user identity manager. If NULL, then no user
profile is currently under consideration.
@param[out] Identifier On return, points to the user identifier.
@param[out] Identifier On return, points to the user identifier.
@retval EFI_SUCCESS User identifier returned successfully.
@retval EFI_NOT_READY No user identifier can be returned.
@retval EFI_ACCESS_DENIED The user has been locked out of this user credential.
@retval EFI_INVALID_PARAMETER This is NULL, or Identifier is NULL.
@retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be
found in user profile database.
**/
EFI_STATUS
EFIAPI
@@ -224,17 +224,17 @@ CredentialUser (
/**
Indicate that user interface interaction has begun for the specified credential.
This function is called when a credential provider is selected by the user. If
This function is called when a credential provider is selected by the user. If
AutoLogon returns FALSE, then the user interface will be constructed by the User
Identity Manager.
Identity Manager.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] AutoLogon On return, points to the credential provider's capabilities
after the credential provider has been selected by the user.
@param[out] AutoLogon On return, points to the credential provider's capabilities
after the credential provider has been selected by the user.
@retval EFI_SUCCESS Credential provider successfully selected.
@retval EFI_INVALID_PARAMETER AutoLogon is NULL.
**/
EFI_STATUS
EFIAPI
@@ -249,9 +249,9 @@ CredentialSelect (
This function is called when a credential provider is deselected by the user.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@retval EFI_SUCCESS Credential provider successfully deselected.
**/
EFI_STATUS
EFIAPI
@@ -262,12 +262,12 @@ CredentialDeselect (
/**
Return the default logon behavior for this user credential.
This function reports the default login behavior regarding this credential provider.
This function reports the default login behavior regarding this credential provider.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[out] AutoLogon On return, holds whether the credential provider should be used
by default to automatically log on the user.
by default to automatically log on the user.
@retval EFI_SUCCESS Default information successfully returned.
@retval EFI_INVALID_PARAMETER AutoLogon is NULL.
@@ -282,24 +282,24 @@ CredentialDefault (
/**
Return information attached to the credential provider.
This function returns user information.
This function returns user information.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] UserInfo Handle of the user information data record.
@param[in] UserInfo Handle of the user information data record.
@param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On
exit, holds the user information. If the buffer is too small
to hold the information, then EFI_BUFFER_TOO_SMALL is returned
and InfoSize is updated to contain the number of bytes actually
required.
@param[in, out] InfoSize On entry, points to the size of Info. On return, points to the
size of the user information.
@param[in, out] InfoSize On entry, points to the size of Info. On return, points to the
size of the user information.
@retval EFI_SUCCESS Information returned successfully.
@retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the
user information. The size required is returned in *InfoSize.
@retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
@retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
@retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
**/
EFI_STATUS
EFIAPI
@@ -316,17 +316,17 @@ CredentialGetInfo (
This function returns the next user information record. To retrieve the first user
information record handle, point UserInfo at a NULL. Each subsequent call will retrieve
another user information record handle until there are no more, at which point UserInfo
will point to NULL.
will point to NULL.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in, out] UserInfo On entry, points to the previous user information handle or NULL
to start enumeration. On exit, points to the next user information
handle or NULL if there is no more user information.
@retval EFI_SUCCESS User information returned.
@retval EFI_NOT_FOUND No more user information found.
@retval EFI_INVALID_PARAMETER UserInfo is NULL.
**/
EFI_STATUS
EFIAPI
@@ -338,15 +338,15 @@ CredentialGetNextInfo (
/**
Delete a user on this credential provider.
This function deletes a user on this credential provider.
This function deletes a user on this credential provider.
@param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
@param[in] User The user profile handle to delete.
@retval EFI_SUCCESS User profile was successfully deleted.
@retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle.
Either the user profile cannot delete on any user profile or cannot delete
on a user profile other than the current user profile.
@retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle.
Either the user profile cannot delete on any user profile or cannot delete
on a user profile other than the current user profile.
@retval EFI_UNSUPPORTED This credential provider does not support deletion in the pre-OS.
@retval EFI_DEVICE_ERROR The new credential could not be deleted because of a device error.
@retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.

View File

@@ -1,11 +1,11 @@
## @file
# Provides a USB credential provider implementation
#
# This module reads a token from a token file that is saved in the root
# This module reads a token from a token file that is saved in the root
# folder of a USB stick. The token file name can be specified by the PCD
# PcdFixedUsbCredentialProviderTokenFileName.
#
# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -45,26 +45,26 @@
HiiLib
UefiLib
BaseCryptLib
[Guids]
## PRODUCES ## Variable:L"UsbCredential"
## CONSUMES ## Variable:L"UsbCredential"
## CONSUMES ## HII
## SOMETIMES_CONSUMES ## GUID # The credential provider identifier
gUsbCredentialProviderGuid
gEfiFileInfoGuid ## SOMETIMES_CONSUMES ## GUID
gEfiUserCredentialClassSecureCardGuid ## SOMETIMES_CONSUMES ## GUID
[Pcd]
gEfiSecurityPkgTokenSpaceGuid.PcdFixedUsbCredentialProviderTokenFileName ## SOMETIMES_CONSUMES
gEfiSecurityPkgTokenSpaceGuid.PcdFixedUsbCredentialProviderTokenFileName ## SOMETIMES_CONSUMES
[Protocols]
gEfiUserCredential2ProtocolGuid ## PRODUCES
gEfiUserManagerProtocolGuid ## SOMETIMES_CONSUMES
gEfiBlockIoProtocolGuid ## SOMETIMES_CONSUMES
gEfiSimpleFileSystemProtocolGuid ## SOMETIMES_CONSUMES
[UserExtensions.TianoCore."ExtraFiles"]
UsbCredentialProviderExtra.uni

View File

@@ -1,7 +1,7 @@
// /** @file
// UsbCredentialProvider Localized Strings and Content
//
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -12,8 +12,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"USB Credential Provider"

View File

@@ -1,7 +1,7 @@
/** @file
String definitions for the USB Credential Provider.
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -24,6 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#string STR_PROVIDER_TYPE_NAME #language en-US "Secure Card Credential Provider"
#language fr-FR "Secure Card Credential Provider (French)"
#string STR_READ_USB_TOKEN_ERROR #language en-US "Read USB Token File Error!"
#language fr-FR "Read USB Token File Error! (French)"
#language fr-FR "Read USB Token File Error! (French)"
#string STR_INSERT_USB_TOKEN #language en-US "Please insert USB key with Token"
#language fr-FR "Please insert USB key with Token (French)"

View File

@@ -1,13 +1,13 @@
/** @file
Load the deferred images after user is identified.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -39,7 +39,7 @@ LoadDeferredImage (
UINTN DriverIndex;
EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
VOID *DriverImage;
UINTN ImageSize;
UINTN ImageSize;
BOOLEAN BootOption;
EFI_HANDLE ImageHandle;
UINTN ExitDataSize;
@@ -77,16 +77,16 @@ LoadDeferredImage (
// Load all the deferred images in this protocol instance.
//
Status = DeferredImage->GetImageInfo(
DeferredImage,
DriverIndex,
&ImageDevicePath,
DeferredImage,
DriverIndex,
&ImageDevicePath,
(VOID **) &DriverImage,
&ImageSize,
&ImageSize,
&BootOption
);
if (EFI_ERROR (Status)) {
break;
}
}
//
// Load and start the image.
@@ -106,7 +106,7 @@ LoadDeferredImage (
//
gBS->SetWatchdogTimer (5 * 60, 0x0000, 0x00, NULL);
Status = gBS->StartImage (ImageHandle, &ExitDataSize, &ExitData);
//
// Clear the Watchdog Timer after the image returns.
//
@@ -115,7 +115,7 @@ LoadDeferredImage (
DriverIndex++;
} while (TRUE);
}
FreePool (HandleBuf);
FreePool (HandleBuf);
}
@@ -134,7 +134,7 @@ LoadDeferredImageInit (
EFI_EVENT Event;
mDeferredImageHandle = ImageHandle;
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_CALLBACK,

View File

@@ -1,13 +1,13 @@
/** @file
The header file for User identify Manager driver.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -239,34 +239,34 @@ UserProfileIdentify (
Find a user using a user information record.
This function searches all user profiles for the specified user information record.
The search starts with the user information record handle following UserInfo and
The search starts with the user information record handle following UserInfo and
continues until either the information is found or there are no more user profiles.
A match occurs when the Info.InfoType field matches the user information record
type and the user information record data matches the portion of Info passed the
type and the user information record data matches the portion of Info passed the
EFI_USER_INFO header.
@param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
@param[in, out] User On entry, points to the previously returned user profile
@param[in, out] User On entry, points to the previously returned user profile
handle, or NULL to start searching with the first user profile.
On return, points to the user profile handle, or NULL if not
found.
@param[in, out] UserInfo On entry, points to the previously returned user information
handle, or NULL to start searching with the first. On return,
handle, or NULL to start searching with the first. On return,
points to the user information handle of the user information
record, or NULL if not found. Can be NULL, in which case only
one user information record per user can be returned.
@param[in] Info Points to the buffer containing the user information to be
compared to the user information record. If NULL, then only
the user information record type is compared. If InfoSize is 0,
record, or NULL if not found. Can be NULL, in which case only
one user information record per user can be returned.
@param[in] Info Points to the buffer containing the user information to be
compared to the user information record. If NULL, then only
the user information record type is compared. If InfoSize is 0,
then the user information record must be empty.
@param[in] InfoSize The size of Info, in bytes.
@param[in] InfoSize The size of Info, in bytes.
@retval EFI_SUCCESS User information was found. User points to the user profile handle,
and UserInfo points to the user information handle.
@retval EFI_NOT_FOUND User information was not found. User points to NULL and UserInfo
@retval EFI_NOT_FOUND User information was not found. User points to NULL and UserInfo
points to NULL.
**/
EFI_STATUS
EFIAPI
@@ -409,5 +409,5 @@ UserProfileGetNextInfo (
IN EFI_USER_PROFILE_HANDLE User,
IN OUT EFI_USER_INFO_HANDLE *UserInfo
);
#endif

View File

@@ -1,13 +1,13 @@
/** @file
Data structure used by the user identify manager driver.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/

View File

@@ -2,8 +2,8 @@
# Produces user manager protocol
#
# This module manages user information and produces user manager protocol.
#
# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
#
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -48,7 +48,7 @@
[Guids]
gEfiIfrTianoGuid ## SOMETIMES_CONSUMES ## GUID
gEfiEventUserProfileChangedGuid ## SOMETIMES_PRODUCES ## Event
## SOMETIMES_PRODUCES ## Variable:L"Userxxxx"
## SOMETIMES_CONSUMES ## Variable:L"Userxxxx"
## CONSUMES ## HII
@@ -64,16 +64,16 @@
gEfiSimpleTextInputExProtocolGuid ## SOMETIMES_CONSUMES
gEfiHiiConfigAccessProtocolGuid ## PRODUCES
gEfiDevicePathProtocolGuid ## PRODUCES
## PRODUCES
## SOMETIMES_PRODUCES ## SystemTable
gEfiUserManagerProtocolGuid
gEfiUserManagerProtocolGuid
[Depex]
gEfiHiiDatabaseProtocolGuid AND
gEfiHiiStringProtocolGuid AND
gEfiFormBrowser2ProtocolGuid
gEfiHiiDatabaseProtocolGuid AND
gEfiHiiStringProtocolGuid AND
gEfiFormBrowser2ProtocolGuid
[UserExtensions.TianoCore."ExtraFiles"]
UserIdentifyManagerExtra.uni

View File

@@ -1,7 +1,7 @@
// /** @file
// UserIdentifyManager Localized Strings and Content
//
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -12,8 +12,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"User Identify Manager"

View File

@@ -1,7 +1,7 @@
/** @file
String definitions for the User Identify Manager driver.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -16,12 +16,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#langdef fr-FR "Francais"
#string STR_TITLE #language en-US "User Identity Manager"
#language fr-FR "User Identity Manager(French)"
#language fr-FR "User Identity Manager(French)"
#string STR_USER_SELECT #language en-US "User Selection"
#language fr-FR "User Selection(French)"
#string STR_PROVIDER_SELECT #language en-US "Provider Selection"
#language fr-FR "User Selection(French)"
#language fr-FR "User Selection(French)"
#string STR_NULL_STRING #language en-US ""
#language fr-FR ""

View File

@@ -1,13 +1,13 @@
/** @file
The functions for access policy modification.
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "UserProfileManager.h"
/**
Collect all the access policy data to mUserInfo.AccessPolicy,
Collect all the access policy data to mUserInfo.AccessPolicy,
and save it to user profile.
**/
@@ -38,7 +38,7 @@ SaveAccessPolicy (
mUserInfo.AccessPolicyLen = 0;
mUserInfo.AccessPolicyModified = TRUE;
OffSet = 0;
//
// Save access right.
//
@@ -51,7 +51,7 @@ SaveAccessPolicy (
Control.Size = (UINT32) Size;
CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
OffSet += sizeof (Control);
//
// Save access setup.
//
@@ -61,10 +61,10 @@ SaveAccessPolicy (
}
Control.Type = EFI_USER_INFO_ACCESS_SETUP;
Control.Size = (UINT32) Size;
Control.Size = (UINT32) Size;
CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
OffSet += sizeof (Control);
if (mAccessInfo.AccessSetup == ACCESS_SETUP_NORMAL) {
CopyGuid ((EFI_GUID *) (mUserInfo.AccessPolicy + OffSet), &gEfiUserInfoAccessSetupNormalGuid);
} else if (mAccessInfo.AccessSetup == ACCESS_SETUP_RESTRICTED) {
@@ -73,7 +73,7 @@ SaveAccessPolicy (
CopyGuid ((EFI_GUID *) (mUserInfo.AccessPolicy + OffSet), &gEfiUserInfoAccessSetupAdminGuid);
}
OffSet += sizeof (EFI_GUID);
//
// Save access of boot order.
//
@@ -83,13 +83,13 @@ SaveAccessPolicy (
}
Control.Type = EFI_USER_INFO_ACCESS_BOOT_ORDER;
Control.Size = (UINT32) Size;
Control.Size = (UINT32) Size;
CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
OffSet += sizeof (Control);
CopyMem ((UINT8 *) (mUserInfo.AccessPolicy + OffSet), &mAccessInfo.AccessBootOrder, sizeof (UINT32));
OffSet += sizeof (UINT32);
//
// Save permit load.
//
@@ -100,14 +100,14 @@ SaveAccessPolicy (
}
Control.Type = EFI_USER_INFO_ACCESS_PERMIT_LOAD;
Control.Size = (UINT32) Size;
Control.Size = (UINT32) Size;
CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
OffSet += sizeof (Control);
CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.LoadPermit, mAccessInfo.LoadPermitLen);
OffSet += mAccessInfo.LoadPermitLen;
}
//
// Save forbid load.
//
@@ -118,14 +118,14 @@ SaveAccessPolicy (
}
Control.Type = EFI_USER_INFO_ACCESS_FORBID_LOAD;
Control.Size = (UINT32) Size;
Control.Size = (UINT32) Size;
CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
OffSet += sizeof (Control);
CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.LoadForbid, mAccessInfo.LoadForbidLen);
OffSet += mAccessInfo.LoadForbidLen;
}
//
// Save permit connect.
//
@@ -136,14 +136,14 @@ SaveAccessPolicy (
}
Control.Type = EFI_USER_INFO_ACCESS_PERMIT_CONNECT;
Control.Size = (UINT32) Size;
Control.Size = (UINT32) Size;
CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
OffSet += sizeof (Control);
CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.ConnectPermit, mAccessInfo.ConnectPermitLen);
OffSet += mAccessInfo.ConnectPermitLen;
}
//
// Save forbid connect.
//
@@ -154,10 +154,10 @@ SaveAccessPolicy (
}
Control.Type = EFI_USER_INFO_ACCESS_FORBID_CONNECT;
Control.Size = (UINT32) Size;
Control.Size = (UINT32) Size;
CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
OffSet += sizeof (Control);
CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.ConnectForbid, mAccessInfo.ConnectForbidLen);
OffSet += mAccessInfo.ConnectForbidLen;
}
@@ -264,11 +264,11 @@ AddDevicePath (
/**
Check whether the DevicePath is in the device path forbid list
Check whether the DevicePath is in the device path forbid list
(mAccessInfo.LoadForbid).
@param[in] DevicePath Points to device path.
@retval TRUE The DevicePath is in the device path forbid list.
@retval FALSE The DevicePath is not in the device path forbid list.
@@ -330,10 +330,10 @@ DisplayLoadPermit(
//
OrderSize = 0;
Status = gRT->GetVariable (
L"DriverOrder",
&gEfiGlobalVariableGuid,
NULL,
&OrderSize,
L"DriverOrder",
&gEfiGlobalVariableGuid,
NULL,
&OrderSize,
NULL
);
if (Status != EFI_BUFFER_TOO_SMALL) {
@@ -346,16 +346,16 @@ DisplayLoadPermit(
}
Status = gRT->GetVariable (
L"DriverOrder",
&gEfiGlobalVariableGuid,
NULL,
&OrderSize,
L"DriverOrder",
&gEfiGlobalVariableGuid,
NULL,
&OrderSize,
Order
);
if (EFI_ERROR (Status)) {
return ;
}
//
// Initialize the container for dynamic opcodes.
//
@@ -400,11 +400,11 @@ DisplayLoadPermit(
if (Var == NULL) {
continue;
}
//
// Check whether the driver is already forbidden.
//
VarPtr = Var;
//
// Skip attribute.
@@ -545,7 +545,7 @@ DisplayConnectPermit (
)
{
//
// Note:
// Note:
// As no architect protocol/interface to be called in ConnectController()
// to verify the device path, just add a place holder for permitted connect
// device path.
@@ -563,7 +563,7 @@ DisplayConnectForbid (
)
{
//
// Note:
// Note:
// As no architect protocol/interface to be called in ConnectController()
// to verify the device path, just add a place holder for forbidden connect
// device path.
@@ -572,11 +572,11 @@ DisplayConnectForbid (
/**
Delete the specified device path by DriverIndex from the forbid device path
Delete the specified device path by DriverIndex from the forbid device path
list (mAccessInfo.LoadForbid).
@param[in] DriverIndex The index of driver in forbidden device path list.
**/
VOID
DeleteFromForbidLoad (
@@ -598,7 +598,7 @@ DeleteFromForbidLoad (
OffSet += DPSize;
DriverIndex--;
}
//
// Specified device path found.
//
@@ -608,8 +608,8 @@ DeleteFromForbidLoad (
OffLen = mAccessInfo.LoadForbidLen - OffSet - DPSize;
if (OffLen > 0) {
CopyMem (
mAccessInfo.LoadForbid + OffSet,
mAccessInfo.LoadForbid + OffSet + DPSize,
mAccessInfo.LoadForbid + OffSet,
mAccessInfo.LoadForbid + OffSet + DPSize,
OffLen
);
}
@@ -619,11 +619,11 @@ DeleteFromForbidLoad (
/**
Add the specified device path by DriverIndex to the forbid device path
Add the specified device path by DriverIndex to the forbid device path
list (mAccessInfo.LoadForbid).
@param[in] DriverIndex The index of driver saved in driver options.
**/
VOID
AddToForbidLoad (
@@ -645,11 +645,11 @@ AddToForbidLoad (
if (Var == NULL) {
return;
}
//
// Save forbid load driver.
//
VarPtr = Var;
//
// Skip attribute.

View File

@@ -1,13 +1,13 @@
/** @file
The functions for identification policy modification.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
provider can't appear twice in one identity policy.
@param[in] NewGuid Points to the credential provider guid.
@retval TRUE The NewGuid was found in the identity policy.
@retval FALSE The NewGuid was not found.
@@ -52,7 +52,7 @@ ProviderAlreadyInPolicy (
}
Offset += Identity->Length;
}
return FALSE;
}
@@ -70,12 +70,12 @@ ProviderAlreadyInPolicy (
EFI_STATUS
EnrollUserOnProvider (
IN EFI_USER_INFO_IDENTITY_POLICY *Identity,
IN EFI_USER_PROFILE_HANDLE User
IN EFI_USER_PROFILE_HANDLE User
)
{
UINTN Index;
EFI_USER_CREDENTIAL2_PROTOCOL *UserCredential;
//
// Find the specified credential provider.
//
@@ -86,7 +86,7 @@ EnrollUserOnProvider (
}
}
return EFI_NOT_FOUND;
return EFI_NOT_FOUND;
}
@@ -103,12 +103,12 @@ EnrollUserOnProvider (
EFI_STATUS
DeleteUserOnProvider (
IN EFI_USER_INFO_IDENTITY_POLICY *Identity,
IN EFI_USER_PROFILE_HANDLE User
IN EFI_USER_PROFILE_HANDLE User
)
{
UINTN Index;
EFI_USER_CREDENTIAL2_PROTOCOL *UserCredential;
//
// Find the specified credential provider.
//
@@ -119,13 +119,13 @@ DeleteUserOnProvider (
}
}
return EFI_NOT_FOUND;
return EFI_NOT_FOUND;
}
/**
Delete User's credental from all the providers that exist in User's identity policy.
@param[in] IdentityPolicy Point to User's identity policy.
@param[in] IdentityPolicyLen The length of the identity policy.
@param[in] User Points to user profile.
@@ -135,7 +135,7 @@ VOID
DeleteCredentialFromProviders (
IN UINT8 *IdentityPolicy,
IN UINTN IdentityPolicyLen,
IN EFI_USER_PROFILE_HANDLE User
IN EFI_USER_PROFILE_HANDLE User
)
{
EFI_USER_INFO_IDENTITY_POLICY *Identity;
@@ -158,7 +158,7 @@ DeleteCredentialFromProviders (
/**
Remove the provider specified by Offset from the new user identification record.
@param[in] IdentityPolicy Point to user identity item in new identification policy.
@param[in] Offset The item offset in the new identification policy.
@@ -187,11 +187,11 @@ DeleteProviderFromPolicy (
if ((Offset + IdentityPolicy->Length) != mUserInfo.NewIdentityPolicyLen) {
//
// This provider is not the last item in the identification policy, delete it and the connector.
//
//
RemainingLen = mUserInfo.NewIdentityPolicyLen - Offset - DeleteLen;
CopyMem ((UINT8 *) IdentityPolicy, (UINT8 *) IdentityPolicy + DeleteLen, RemainingLen);
}
mUserInfo.NewIdentityPolicyLen -= DeleteLen;
mUserInfo.NewIdentityPolicyLen -= DeleteLen;
}
@@ -201,7 +201,7 @@ DeleteProviderFromPolicy (
It is invoked when 'add option' in UI is pressed.
@param[in] NewGuid Points to the credential provider guid.
**/
VOID
AddProviderToPolicy (
@@ -248,7 +248,7 @@ AddProviderToPolicy (
NewPolicyInfoLen = mUserInfo.NewIdentityPolicyLen + Policy->Length;
FreePool (mUserInfo.NewIdentityPolicy);
}
//
// Save credential provider.
//
@@ -325,7 +325,7 @@ UpdateCredentialProvider (
@retval TRUE The policy is a valid identity policy.
@retval FALSE The policy is not a valid identity policy.
**/
BOOLEAN
CheckNewIdentityPolicy (
@@ -337,7 +337,7 @@ CheckNewIdentityPolicy (
EFI_INPUT_KEY Key;
UINTN Offset;
UINT32 OpCode;
//
// Check policy expression.
//
@@ -349,7 +349,7 @@ CheckNewIdentityPolicy (
//
Identity = (EFI_USER_INFO_IDENTITY_POLICY *) (PolicyInfo + Offset);
switch (Identity->Type) {
case EFI_USER_INFO_IDENTITY_TRUE:
break;
@@ -408,11 +408,11 @@ CheckNewIdentityPolicy (
/**
Save the identity policy and update UI with it.
This function will verify the new identity policy, in current implementation,
This function will verify the new identity policy, in current implementation,
the identity policy can be: T, P & P & P & ..., P | P | P | ...
Here, "T" means "True", "P" means "Credential Provider", "&" means "and", "|" means "or".
Other identity policies are not supported.
Other identity policies are not supported.
**/
VOID
@@ -439,7 +439,7 @@ SaveIdentityPolicy (
if (EFI_ERROR (Status)) {
return ;
}
//
// Update the informantion on credential provider.
//
@@ -447,7 +447,7 @@ SaveIdentityPolicy (
if (EFI_ERROR (Status)) {
return ;
}
//
// Save new identification policy.
//
@@ -461,7 +461,7 @@ SaveIdentityPolicy (
Status = mUserManager->SetInfo (mUserManager, mModifyUser, &UserInfo, Info, Info->InfoSize);
FreePool (Info);
//
// Update the mUserInfo.IdentityPolicy by mUserInfo.NewIdentityPolicy
//
@@ -473,7 +473,7 @@ SaveIdentityPolicy (
mUserInfo.NewIdentityPolicy = NULL;
mUserInfo.NewIdentityPolicyLen = 0;
mUserInfo.NewIdentityPolicyModified = FALSE;
mUserInfo.NewIdentityPolicyModified = FALSE;
//
// Update identity policy choice.
@@ -494,7 +494,7 @@ AddIdentityPolicyItem (
if (mProviderInfo->Count == 0) {
return ;
}
//
// Check the identity policy.
//

View File

@@ -1,13 +1,13 @@
/** @file
The functions to add a user profile.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -17,11 +17,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
/**
Get user name from the popup windows.
@param[in, out] UserNameLen On entry, point to UserName buffer lengh, in bytes.
On exit, point to input user name length, in bytes.
@param[out] UserName The buffer to hold the input user name.
@retval EFI_ABORTED It is given up by pressing 'ESC' key.
@retval EFI_NOT_READY Not a valid input at all.
@retval EFI_SUCCESS Get a user name successfully.
@@ -100,7 +100,7 @@ GetUserNameInput (
*UserNameLen = NameLen * sizeof (CHAR16);
CopyMem (UserName, Name, *UserNameLen);
return EFI_SUCCESS;
}
@@ -112,7 +112,7 @@ GetUserNameInput (
@param[in] UserName Point to the buffer of user name.
@retval EFI_NOT_READY The usernme in mAddUserName had been used.
@retval EFI_SUCCESS Change the user's username successfully with
@retval EFI_SUCCESS Change the user's username successfully with
username in mAddUserName.
**/
@@ -127,13 +127,13 @@ SetUserName (
EFI_USER_INFO_HANDLE UserInfo;
EFI_USER_PROFILE_HANDLE TempUser;
EFI_USER_INFO *NewUserInfo;
NewUserInfo = AllocateZeroPool (sizeof (EFI_USER_INFO) + UserNameLen);
ASSERT (NewUserInfo != NULL);
NewUserInfo->InfoType = EFI_USER_INFO_NAME_RECORD;
NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
EFI_USER_INFO_PUBLIC |
NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
EFI_USER_INFO_PUBLIC |
EFI_USER_INFO_EXCLUSIVE;
NewUserInfo->InfoSize = (UINT32) (sizeof (EFI_USER_INFO) + UserNameLen);
CopyMem ((UINT8 *) (NewUserInfo + 1), UserName, UserNameLen);
@@ -181,7 +181,7 @@ SetCreateDate (
EFI_USER_INFO_HANDLE UserInfo;
EFI_USER_INFO_CREATE_DATE Date;
EFI_USER_INFO *NewUserInfo;
NewUserInfo = AllocateZeroPool (
sizeof (EFI_USER_INFO) +
sizeof (EFI_USER_INFO_CREATE_DATE)
@@ -189,8 +189,8 @@ SetCreateDate (
ASSERT (NewUserInfo != NULL);
NewUserInfo->InfoType = EFI_USER_INFO_CREATE_DATE_RECORD;
NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
EFI_USER_INFO_PUBLIC |
NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
EFI_USER_INFO_PUBLIC |
EFI_USER_INFO_EXCLUSIVE;
NewUserInfo->InfoSize = sizeof (EFI_USER_INFO) + sizeof (EFI_USER_INFO_CREATE_DATE);
Status = gRT->GetTime (&Date, NULL);
@@ -215,7 +215,7 @@ SetCreateDate (
/**
Set the default identity policy of the specified user.
@param[in] User Handle of a user profile.
@param[in] User Handle of a user profile.
**/
VOID
@@ -226,20 +226,20 @@ SetIdentityPolicy (
EFI_USER_INFO_IDENTITY_POLICY *Policy;
EFI_USER_INFO_HANDLE UserInfo;
EFI_USER_INFO *NewUserInfo;
NewUserInfo = AllocateZeroPool (
sizeof (EFI_USER_INFO) +
sizeof (EFI_USER_INFO) +
sizeof (EFI_USER_INFO_IDENTITY_POLICY)
);
ASSERT (NewUserInfo != NULL);
Policy = (EFI_USER_INFO_IDENTITY_POLICY *) (NewUserInfo + 1);
Policy->Type = EFI_USER_INFO_IDENTITY_TRUE;
Policy->Length = sizeof (EFI_USER_INFO_IDENTITY_POLICY);
NewUserInfo->InfoType = EFI_USER_INFO_IDENTITY_POLICY_RECORD;
NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
EFI_USER_INFO_PUBLIC |
NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
EFI_USER_INFO_PUBLIC |
EFI_USER_INFO_EXCLUSIVE;
NewUserInfo->InfoSize = sizeof (EFI_USER_INFO) + Policy->Length;
UserInfo = NULL;
@@ -257,7 +257,7 @@ SetIdentityPolicy (
/**
Set the default access policy of the specified user.
@param[in] User Handle of a user profile.
@param[in] User Handle of a user profile.
**/
VOID
@@ -268,20 +268,20 @@ SetAccessPolicy (
EFI_USER_INFO_ACCESS_CONTROL *Control;
EFI_USER_INFO_HANDLE UserInfo;
EFI_USER_INFO *NewUserInfo;
NewUserInfo = AllocateZeroPool (
sizeof (EFI_USER_INFO) +
sizeof (EFI_USER_INFO) +
sizeof (EFI_USER_INFO_ACCESS_CONTROL)
);
ASSERT (NewUserInfo != NULL);
Control = (EFI_USER_INFO_ACCESS_CONTROL *) (NewUserInfo + 1);
Control->Type = EFI_USER_INFO_ACCESS_ENROLL_SELF;
Control->Size = sizeof (EFI_USER_INFO_ACCESS_CONTROL);
NewUserInfo->InfoType = EFI_USER_INFO_ACCESS_POLICY_RECORD;
NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
EFI_USER_INFO_PUBLIC |
NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
EFI_USER_INFO_PUBLIC |
EFI_USER_INFO_EXCLUSIVE;
NewUserInfo->InfoSize = sizeof (EFI_USER_INFO) + Control->Size;
UserInfo = NULL;
@@ -315,7 +315,7 @@ CallAddUser (
QuestionStr = NULL;
PromptStr = NULL;
//
// Get user name to add.
//
@@ -324,7 +324,7 @@ CallAddUser (
if (EFI_ERROR (Status)) {
if (Status != EFI_ABORTED) {
QuestionStr = GetStringById (STRING_TOKEN (STR_GET_USERNAME_FAILED));
PromptStr = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
PromptStr = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
goto Done;
}
return ;
@@ -337,7 +337,7 @@ CallAddUser (
Status = mUserManager->Create (mUserManager, &User);
if (EFI_ERROR (Status)) {
QuestionStr = GetStringById (STRING_TOKEN (STR_CREATE_PROFILE_FAILED));
PromptStr = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
PromptStr = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
} else {
//
// Add default user information.
@@ -345,7 +345,7 @@ CallAddUser (
Status = SetUserName (User, UserNameLen, UserName);
if (EFI_ERROR (Status)) {
QuestionStr = GetStringById (STRING_TOKEN (STR_USER_ALREADY_EXISTED));
PromptStr = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
PromptStr = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
goto Done;
}
@@ -354,7 +354,7 @@ CallAddUser (
SetAccessPolicy (User);
QuestionStr = GetStringById (STRING_TOKEN (STR_CREATE_PROFILE_SUCCESS));
PromptStr = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
PromptStr = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
}
Done:

View File

@@ -1,13 +1,13 @@
/** @file
The functions to delete a user profile.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -17,12 +17,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
/**
Get the username from the specified user.
@param[in] User Handle of a user profile.
@param[in] User Handle of a user profile.
@retval EFI_STRING_ID The String Id of the user's username.
**/
EFI_STRING_ID
EFI_STRING_ID
GetUserName (
IN EFI_USER_PROFILE_HANDLE User
)
@@ -35,14 +35,14 @@ GetUserName (
UINTN NameLen;
CHAR16 UserName[USER_NAME_LENGTH];
EFI_STRING_ID UserId;
//
// Allocate user information memory.
//
MemSize = sizeof (EFI_USER_INFO) + 63;
Info = AllocateZeroPool (MemSize);
ASSERT (Info != NULL);
//
// Get user name information.
//
@@ -116,7 +116,7 @@ GetUserName (
/**
Add a username item in form.
@param[in] User Points to the user profile whose username is added.
@param[in] User Points to the user profile whose username is added.
@param[in] Index The index of the user in the user name list
@param[in] OpCodeHandle Points to container for dynamic created opcodes.
@@ -137,7 +137,7 @@ AddUserToForm (
if (NameId == 0) {
return ;
}
//
// Create user name option.
//
@@ -173,7 +173,7 @@ AddUserToForm (
/**
Delete the user specified by UserIndex in user profile database.
@param[in] UserIndex The index of user in the user name list
@param[in] UserIndex The index of user in the user name list
to be deleted.
**/
@@ -197,7 +197,7 @@ DeleteUser (
if (EFI_ERROR (Status)) {
goto Done;
}
while (UserIndex > 1) {
Status = mUserManager->GetNext (mUserManager, &User);
if (EFI_ERROR (Status)) {
@@ -232,7 +232,7 @@ DeleteUser (
ASSERT (Info != NULL);
DeleteCredentialFromProviders ((UINT8 *)(Info + 1), Info->InfoSize - sizeof (EFI_USER_INFO), User);
FreePool (Info);
Status = mUserManager->Delete (mUserManager, User);
if (EFI_ERROR (Status)) {
goto Done;
@@ -245,7 +245,7 @@ DeleteUser (
L"Please Press Any Key to Continue ...",
NULL
);
return ;
return ;
}
Done:

View File

@@ -1,17 +1,17 @@
/** @file
This driver is a configuration tool for adding, deleting or modifying user
profiles, including gathering the necessary information to ascertain their
identity in the future, updating user access policy and identification
This driver is a configuration tool for adding, deleting or modifying user
profiles, including gathering the necessary information to ascertain their
identity in the future, updating user access policy and identification
policy, etc.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -71,12 +71,12 @@ GetStringById (
/**
This function gets all the credential providers in the system and saved them
This function gets all the credential providers in the system and saved them
to mProviderInfo.
@retval EFI_SUCESS Init credential provider database successfully.
@retval Others Fail to init credential provider database.
**/
EFI_STATUS
InitProviderInfo (
@@ -86,8 +86,8 @@ InitProviderInfo (
EFI_STATUS Status;
UINTN HandleCount;
EFI_HANDLE *HandleBuf;
UINTN Index;
UINTN Index;
//
// Try to find all the user credential provider driver.
//
@@ -103,7 +103,7 @@ InitProviderInfo (
if (EFI_ERROR (Status)) {
return Status;
}
//
// Get provider infomation.
//
@@ -111,7 +111,7 @@ InitProviderInfo (
FreePool (mProviderInfo);
}
mProviderInfo = AllocateZeroPool (
sizeof (CREDENTIAL_PROVIDER_INFO) -
sizeof (CREDENTIAL_PROVIDER_INFO) -
sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) +
HandleCount * sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *)
);
@@ -192,7 +192,7 @@ UserProfileManagerCallback (
if (QuestionId != QUESTIONID_USER_MANAGE) {
return EFI_SUCCESS;
}
//
// Get current user
//
@@ -202,7 +202,7 @@ UserProfileManagerCallback (
DEBUG ((DEBUG_ERROR, "Error: current user does not exist!\n"));
return EFI_NOT_READY;
}
//
// Get current user's right information.
//
@@ -210,7 +210,7 @@ UserProfileManagerCallback (
if (EFI_ERROR (Status)) {
CurrentAccessRight = EFI_USER_INFO_ACCESS_ENROLL_SELF;
}
//
// Init credential provider information.
//
@@ -218,16 +218,16 @@ UserProfileManagerCallback (
if (EFI_ERROR (Status)) {
return Status;
}
//
// Initialize the container for dynamic opcodes.
//
StartOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (StartOpCodeHandle != NULL);
EndOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (EndOpCodeHandle != NULL);
//
// Create Hii Extend Label OpCode.
//
@@ -239,7 +239,7 @@ UserProfileManagerCallback (
);
StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
StartLabel->Number = LABEL_USER_MANAGE_FUNC;
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (
EndOpCodeHandle,
&gEfiIfrTianoGuid,
@@ -248,7 +248,7 @@ UserProfileManagerCallback (
);
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
EndLabel->Number = LABEL_END;
//
// Add user profile option.
//
@@ -264,7 +264,7 @@ UserProfileManagerCallback (
0 // Action String ID
);
}
//
// Add modify user profile option.
//
@@ -276,7 +276,7 @@ UserProfileManagerCallback (
EFI_IFR_FLAG_CALLBACK, // Question flag
KEY_MODIFY_USER // Question ID
);
//
// Add delete user profile option
//
@@ -290,7 +290,7 @@ UserProfileManagerCallback (
KEY_DEL_USER // Question ID
);
}
HiiUpdateForm (
mCallbackInfo->HiiHandle, // HII handle
&gUserProfileManagerGuid, // Formset GUID
@@ -298,10 +298,10 @@ UserProfileManagerCallback (
StartOpCodeHandle, // Label for where to insert opcodes
EndOpCodeHandle // Replace data
);
HiiFreeOpCodeHandle (StartOpCodeHandle);
HiiFreeOpCodeHandle (EndOpCodeHandle);
return EFI_SUCCESS;
}
break;
@@ -311,14 +311,14 @@ UserProfileManagerCallback (
break;
case EFI_BROWSER_ACTION_CHANGED:
{
{
//
// Handle the request from form.
//
if ((Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
}
//
// Judge first 2 bits.
//
@@ -392,7 +392,7 @@ UserProfileManagerCallback (
//
// Change credential provider option.
//
case KEY_MODIFY_PROV:
case KEY_MODIFY_PROV:
mProviderChoice = Value->u8;
break;
@@ -556,14 +556,14 @@ UserProfileManagerCallback (
case EFI_BROWSER_ACTION_CHANGING:
{
{
//
// Handle the request from form.
//
if (Value == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Judge first 2 bits.
//
@@ -666,19 +666,19 @@ UserProfileManagerCallback (
case KEY_PERMIT_MODIFY:
DisplayLoadPermit ();
break;
//
// Forbid load device path.
//
case KEY_FORBID_MODIFY:
DisplayLoadForbid ();
break;
default:
break;
}
break;
//
// Connect device path form.
//
@@ -693,14 +693,14 @@ UserProfileManagerCallback (
case KEY_PERMIT_MODIFY:
DisplayConnectPermit ();
break;
//
// Forbid connect device path.
//
case KEY_FORBID_MODIFY:
DisplayConnectForbid ();
break;
default:
break;
}
@@ -839,7 +839,7 @@ UserProfileManagerInit (
if (EFI_ERROR (Status)) {
return EFI_SUCCESS;
}
//
// Initialize driver private data.
//
@@ -847,14 +847,14 @@ UserProfileManagerInit (
ZeroMem (&mAccessInfo, sizeof (mAccessInfo));
CallbackInfo = AllocateZeroPool (sizeof (USER_PROFILE_MANAGER_CALLBACK_INFO));
ASSERT (CallbackInfo != NULL);
ASSERT (CallbackInfo != NULL);
CallbackInfo->Signature = USER_PROFILE_MANAGER_SIGNATURE;
CallbackInfo->ConfigAccess.ExtractConfig = FakeExtractConfig;
CallbackInfo->ConfigAccess.RouteConfig = FakeRouteConfig;
CallbackInfo->ConfigAccess.Callback = UserProfileManagerCallback;
CallbackInfo->DriverHandle = NULL;
//
// Install Device Path Protocol and Config Access protocol to driver handle.
//
@@ -878,10 +878,10 @@ UserProfileManagerInit (
UserProfileManagerVfrBin,
NULL
);
ASSERT (CallbackInfo->HiiHandle != NULL);
ASSERT (CallbackInfo->HiiHandle != NULL);
mCallbackInfo = CallbackInfo;
return Status;
}

View File

@@ -1,13 +1,13 @@
/** @file
The header file for user profile manager driver.
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -55,7 +55,7 @@ typedef struct {
EFI_TIME UsageDate;
UINTN AccessPolicyLen;
UINTN IdentityPolicyLen;
UINTN NewIdentityPolicyLen;
UINTN NewIdentityPolicyLen;
UINT8 *AccessPolicy;
UINT8 *IdentityPolicy;
UINT8 *NewIdentityPolicy;
@@ -197,7 +197,7 @@ DeleteUser (
/**
Add a username item in form.
@param[in] User Points to the user profile whose username is added.
@param[in] User Points to the user profile whose username is added.
@param[in] Index The index of the user in the user name list.
@param[in] OpCodeHandle Points to container for dynamic created opcodes.
@@ -216,7 +216,7 @@ AddUserToForm (
and access policy are displayed.
@param[in] UserIndex The index of the user in display list to modify.
**/
VOID
ModifyUserInfo (
@@ -224,7 +224,7 @@ ModifyUserInfo (
);
/**
Get the username from user input and update username string in Hii
Get the username from user input and update username string in Hii
database with it.
**/
@@ -253,11 +253,11 @@ AddIdentityPolicyItem (
/**
Save the identity policy and update UI with it.
This function will verify the new identity policy, in current implementation,
This function will verify the new identity policy, in current implementation,
the identity policy can be: T, P & P & P & ..., P | P | P | ...
Here, "T" means "True", "P" means "Credential Provider", "&" means "and", "|" means "or".
Other identity policies are not supported.
Other identity policies are not supported.
**/
VOID
@@ -270,7 +270,7 @@ SaveIdentityPolicy (
In this form, access right, access setu,p and access boot order are dynamically
added. Load devicepath and connect devicepath are displayed too.
**/
VOID
ModidyAccessPolicy (
@@ -278,7 +278,7 @@ ModidyAccessPolicy (
);
/**
Collect all the access policy data to mUserInfo.AccessPolicy,
Collect all the access policy data to mUserInfo.AccessPolicy,
and save it to user profile.
**/
@@ -338,23 +338,23 @@ DisplayConnectForbid (
);
/**
Delete the specified device path by DriverIndex from the forbid device path
Delete the specified device path by DriverIndex from the forbid device path
list (mAccessInfo.LoadForbid).
@param[in] DriverIndex The index of driver in a forbidden device path list.
**/
VOID
DeleteFromForbidLoad (
IN UINT16 DriverIndex
);
/**
Add the specified device path by DriverIndex to the forbid device path
Add the specified device path by DriverIndex to the forbid device path
list (mAccessInfo.LoadForbid).
@param[in] DriverIndex The index of driver saved in driver options.
**/
VOID
AddToForbidLoad (
@@ -363,11 +363,11 @@ AddToForbidLoad (
/**
Get user name from the popup windows.
@param[in, out] UserNameLen On entry, point to the buffer lengh of UserName.
On exit, point to the input user name length.
@param[out] UserName The buffer to hold the input user name.
@retval EFI_ABORTED It is given up by pressing 'ESC' key.
@retval EFI_NOT_READY Not a valid input at all.
@retval EFI_SUCCESS Get a user name successfully.
@@ -385,7 +385,7 @@ GetUserNameInput (
@param[in] User Handle of the user whose information will be searched.
@param[in] InfoType The user information type to find.
@param[out] UserInfo Points to user information handle found.
@retval EFI_SUCCESS Find the user information successfully.
@retval Others Fail to find the user information.
@@ -418,7 +418,7 @@ ResolveIdentityPolicy (
@param[in] ValidLen The valid access policy length.
@param[in] ExpandLen The length that is needed to expand.
**/
VOID
ExpandMemory (
@@ -428,7 +428,7 @@ ExpandMemory (
/**
Delete User's credental from all the providers that exist in User's identity policy.
@param[in] IdentityPolicy Point to User's identity policy.
@param[in] IdentityPolicyLen The length of the identity policy.
@param[in] User Points to user profile.
@@ -438,7 +438,7 @@ VOID
DeleteCredentialFromProviders (
IN UINT8 *IdentityPolicy,
IN UINTN IdentityPolicyLen,
IN EFI_USER_PROFILE_HANDLE User
IN EFI_USER_PROFILE_HANDLE User
);
#endif

View File

@@ -1,13 +1,13 @@
/** @file
The form data for user profile manager driver.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -47,7 +47,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define LABEL_END 0x00F0
//
// First form key (Add/modify/del user profile).
// First form key (Add/modify/del user profile).
// First 2 bits (bit 16~15).
//
#define KEY_MODIFY_USER 0x4000
@@ -77,7 +77,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Specified key, used in VFR (KEY_MODIFY_USER | KEY_SELECT_USER | KEY_MODIFY_NAME).
//
#define KEY_MODIFY_USER_NAME 0x5200
#define KEY_MODIFY_USER_NAME 0x5200
//
// Modify identity policy form key.
@@ -134,7 +134,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Device path modify key.
// 2 bits (bit 12~11).
//
//
#define KEY_LOAD_PERMIT_MODIFY 0x0000
#define KEY_LOAD_FORBID_MODIFY 0x0400
#define KEY_CONNECT_PERMIT_MODIFY 0x0800

View File

@@ -4,7 +4,7 @@
# By this module, user can add/update/delete user profiles, and can also
# modify the user access policy and the user identification policy.
#
# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -50,7 +50,7 @@
HiiLib
UefiLib
DevicePathLib
[Guids]
gEfiIfrTianoGuid ## SOMETIMES_CONSUMES ## GUID
gEfiUserInfoAccessSetupAdminGuid ## SOMETIMES_CONSUMES ## GUID
@@ -66,7 +66,7 @@
[Depex]
gEfiUserManagerProtocolGuid
[UserExtensions.TianoCore."ExtraFiles"]
UserProfileManagerExtra.uni

View File

@@ -1,7 +1,7 @@
// /** @file
// UserProfileManager Localized Strings and Content
//
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -12,8 +12,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"User Profile Manager"

View File

@@ -1,13 +1,13 @@
/** @file
String definitions for User Profile Manager driver.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -20,139 +20,139 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#string STR_FORMSET_TITLE #language en-US "User Manager"
#language fr-FR "User Manager(French)"
#string STR_TITLE_HELP #language en-US "This selection will take you to the User Manager"
#language fr-FR "This selection will take you to the User Manager(French)"
#language fr-FR "This selection will take you to the User Manager(French)"
#string STR_USERMAN_TITLE #language en-US "User Manager"
#language fr-FR "User Manager(French)"
#string STR_ADD_USER_TITLE #language en-US "Add User Profile"
#language fr-FR "Add User Profile(French)"
#string STR_ADD_USER_HELP #language en-US "Add User Profile to User Database"
#language fr-FR "Add User Profile to User Database(French)"
#string STR_MODIFY_USER_TITLE #language en-US "Modify User Profile"
#language fr-FR "Modify User Profile(French)"
#string STR_MODIFY_USER_HELP #language en-US "Modify User Profile Information"
#language fr-FR "Modify User Profile Information(French)"
#string STR_DELETE_USER_TITLE #language en-US "Delete User Profile"
#language fr-FR "Delete User Profile(French)"
#string STR_ADD_USER_TITLE #language en-US "Add User Profile"
#language fr-FR "Add User Profile(French)"
#string STR_ADD_USER_HELP #language en-US "Add User Profile to User Database"
#language fr-FR "Add User Profile to User Database(French)"
#string STR_MODIFY_USER_TITLE #language en-US "Modify User Profile"
#language fr-FR "Modify User Profile(French)"
#string STR_MODIFY_USER_HELP #language en-US "Modify User Profile Information"
#language fr-FR "Modify User Profile Information(French)"
#string STR_DELETE_USER_TITLE #language en-US "Delete User Profile"
#language fr-FR "Delete User Profile(French)"
#string STR_DELETE_USER_HELP #language en-US "Delete User Profile from User Database"
#language fr-FR "Delete User Profile from User Database(French)"
#string STR_USER_INFO #language en-US "User Profile Information"
#language fr-FR "User Profile Information(French)"
#string STR_USER_NAME #language en-US "User Name"
#language fr-FR "User Name(French)"
#string STR_USER_NAME_VAL #language en-US ""
#language fr-FR ""
#string STR_CREATE_DATE #language en-US "Create Date"
#language fr-FR "Create Date(French)"
#string STR_CREATE_DATE_VAL #language en-US ""
#language fr-FR ""
#string STR_USAGE_DATE #language en-US "Usage Date"
#language fr-FR "Usage Date(French)"
#string STR_USAGE_DATE_VAL #language en-US ""
#language fr-FR ""
#string STR_USAGE_COUNT #language en-US "Usage Count"
#language fr-FR "Usage Count(French)"
#string STR_USAGE_COUNT_VAL #language en-US ""
#language fr-FR ""
#string STR_IDENTIFY_POLICY #language en-US "Identify Policy"
#language fr-FR "Identify Policy(French)"
#string STR_IDENTIFY_POLICY_VAL #language en-US ""
#language fr-FR ""
#string STR_ACCESS_POLICY #language en-US "Access Policy"
#language fr-FR "Access Policy(French)"
#string STR_SAVE #language en-US "Save & Exit"
#language fr-FR "Save & Exit(French)"
#string STR_IDENTIFY_SAVE_HELP #language en-US "Save Identify Policy and Exit"
#language fr-FR "Save Identify Policy and Exit(French)"
#string STR_PROVIDER #language en-US "Credential Provider"
#language fr-FR "Credential Provider(French)"
#string STR_PROVIDER_HELP #language en-US "Select Credential Provider Option"
#language fr-FR "Select Credential Provider Option(French)"
#string STR_OR_CON #language en-US "Or"
#language fr-FR "Or(French)"
#string STR_AND_CON #language en-US "And"
#language fr-FR "And(French)"
#string STR_CONNECTOR #language en-US "Logical Connector"
#language fr-FR "Logical Connector(French)"
#string STR_CONNECTOR_HELP #language en-US "Select Logical Connector Option"
#language fr-FR "Select Logical Connector Option(French)"
#string STR_IDENTIFY_POLICY_VALUE #language en-US ""
#language fr-FR ""
#language fr-FR "Delete User Profile from User Database(French)"
#string STR_USER_INFO #language en-US "User Profile Information"
#language fr-FR "User Profile Information(French)"
#string STR_USER_NAME #language en-US "User Name"
#language fr-FR "User Name(French)"
#string STR_USER_NAME_VAL #language en-US ""
#language fr-FR ""
#string STR_CREATE_DATE #language en-US "Create Date"
#language fr-FR "Create Date(French)"
#string STR_CREATE_DATE_VAL #language en-US ""
#language fr-FR ""
#string STR_USAGE_DATE #language en-US "Usage Date"
#language fr-FR "Usage Date(French)"
#string STR_USAGE_DATE_VAL #language en-US ""
#language fr-FR ""
#string STR_USAGE_COUNT #language en-US "Usage Count"
#language fr-FR "Usage Count(French)"
#string STR_USAGE_COUNT_VAL #language en-US ""
#language fr-FR ""
#string STR_IDENTIFY_POLICY #language en-US "Identify Policy"
#language fr-FR "Identify Policy(French)"
#string STR_IDENTIFY_POLICY_VAL #language en-US ""
#language fr-FR ""
#string STR_ACCESS_POLICY #language en-US "Access Policy"
#language fr-FR "Access Policy(French)"
#string STR_SAVE #language en-US "Save & Exit"
#language fr-FR "Save & Exit(French)"
#string STR_IDENTIFY_SAVE_HELP #language en-US "Save Identify Policy and Exit"
#language fr-FR "Save Identify Policy and Exit(French)"
#string STR_PROVIDER #language en-US "Credential Provider"
#language fr-FR "Credential Provider(French)"
#string STR_PROVIDER_HELP #language en-US "Select Credential Provider Option"
#language fr-FR "Select Credential Provider Option(French)"
#string STR_OR_CON #language en-US "Or"
#language fr-FR "Or(French)"
#string STR_AND_CON #language en-US "And"
#language fr-FR "And(French)"
#string STR_CONNECTOR #language en-US "Logical Connector"
#language fr-FR "Logical Connector(French)"
#string STR_CONNECTOR_HELP #language en-US "Select Logical Connector Option"
#language fr-FR "Select Logical Connector Option(French)"
#string STR_IDENTIFY_POLICY_VALUE #language en-US ""
#language fr-FR ""
#string STR_IDENTIFY_POLICY_HELP #language en-US "Current Identify Policy"
#language fr-FR "Current Identify Policy(French)"
#string STR_ADD_OPTION #language en-US "Add Option"
#language fr-FR "Add Option(French)"
#string STR_ADD_OPTION_HELP #language en-US "Add This Option to Identify Policy"
#language fr-FR "Add This Option to Identify Policy(French)"
#string STR_ACCESS_SAVE_HELP #language en-US "Save Access Policy and Exit"
#language fr-FR "Save Access Policy and Exit(French)"
#string STR_ACCESS_RIGHT #language en-US "Access Right"
#language fr-FR "Access Right(French)"
#string STR_ACCESS_RIGHT_HELP #language en-US "Select Access Right Option"
#language fr-FR "Select Access Right Option(French)"
#string STR_NORMAL #language en-US "Normal"
#language fr-FR "Normal(French)"
#string STR_ENROLL #language en-US "Enroll"
#language fr-FR "Enroll(French)"
#string STR_MANAGE #language en-US "Manage"
#language fr-FR "Manage(French)"
#string STR_ACCESS_SETUP #language en-US "Access Setup"
#language fr-FR "Access Setup(French)"
#string STR_ACCESS_SETUP_HELP #language en-US "Select Access Setup Option"
#language fr-FR "Selelct Access Setup Option(French)"
#string STR_RESTRICTED #language en-US "Restricted"
#language fr-FR "Restricted(French)"
#string STR_ADMIN #language en-US "Admin"
#language fr-FR "Admin(French)"
#string STR_BOOR_ORDER #language en-US "Access Boot Order"
#language fr-FR "Access Boot Order(French)"
#string STR_BOOT_ORDER_HELP #language en-US "Select Access Boot Order Option"
#language fr-FR "Select Access Boot Order Option(French)"
#string STR_INSERT #language en-US "Insert"
#language fr-FR "Insert(French)"
#string STR_APPEND #language en-US "Append"
#language fr-FR "Append(French)"
#string STR_REPLACE #language en-US "Replace"
#language fr-FR "Replace(French)"
#string STR_NODEFAULT #language en-US "Nodefault"
#language fr-FR "Nodefault(French)"
#string STR_LOAD #language en-US "Load Device Path"
#language fr-FR "Load Device Path(French)"
#string STR_LOAD_HELP #language en-US "Select Permit/Forbid Load Device Path"
#language fr-FR "Select Permit/Forbid Load Device Path(French)"
#string STR_CONNECT #language en-US "Connect Device Path"
#language fr-FR "Connect Device Path(French)"
#string STR_CONNECT_HELP #language en-US "Select Permit/Forbid Connect Device Path"
#language fr-FR "Select Permit/Forbid Connect Device Path(French)"
#string STR_LOAD_PERMIT #language en-US "Permit Load Device Path"
#language fr-FR "Permit Load Device Path(French)"
#string STR_LOAD_PERMIT_HELP #language en-US "Change Permit Load Device Path to Forbid"
#language fr-FR "Change Permit Load Device Path to Forbid(French)"
#string STR_LOAD_FORBID #language en-US "Forbid Load Device Path"
#language fr-FR "Forbid Load Device Path(French)"
#string STR_LOAD_FORBID_HELP #language en-US "Change Forbid Load Device Path to Permit"
#language fr-FR "Change Forbid Load Device Path to Permit(French)"
#string STR_CONNECT_PERMIT #language en-US "Permit Connect Device Path"
#language fr-FR "Permit Connect Device Path(French)"
#string STR_CONNECT_PERMIT_HELP #language en-US "Change Permit Connect Device Path to Forbid"
#language fr-FR "Change Permit Connect Device Path to Forbid(French)"
#string STR_CONNECT_FORBID #language en-US "Forbid Connect Device Path"
#language fr-FR "Forbid Connect Device Path(French)"
#string STR_CONNECT_FORBID_HELP #language en-US "Change Forbid Connect Device Path to Permit"
#language fr-FR "Change Forbid Connect Device Path to Permit(French)"
#string STR_PRESS_KEY_CONTINUE #language en-US "Press ENTER to Continue, Other Key to Cancel ..."
#language fr-FR "Press ENTER to Continue, Other Key to Cancel ...(French)"
#string STR_MOVE_TO_FORBID_LIST #language en-US "Are You Sure to Move It to Forbid List?"
#language fr-FR "Are You Sure to Move It to Forbid List?(French)"
#string STR_MOVE_TO_PERMIT_LIST #language en-US "Are You Sure to Move It to Permit List?"
#language fr-FR "Are You Sure to Move It to Permit List?(French)"
#language fr-FR "Current Identify Policy(French)"
#string STR_ADD_OPTION #language en-US "Add Option"
#language fr-FR "Add Option(French)"
#string STR_ADD_OPTION_HELP #language en-US "Add This Option to Identify Policy"
#language fr-FR "Add This Option to Identify Policy(French)"
#string STR_ACCESS_SAVE_HELP #language en-US "Save Access Policy and Exit"
#language fr-FR "Save Access Policy and Exit(French)"
#string STR_ACCESS_RIGHT #language en-US "Access Right"
#language fr-FR "Access Right(French)"
#string STR_ACCESS_RIGHT_HELP #language en-US "Select Access Right Option"
#language fr-FR "Select Access Right Option(French)"
#string STR_NORMAL #language en-US "Normal"
#language fr-FR "Normal(French)"
#string STR_ENROLL #language en-US "Enroll"
#language fr-FR "Enroll(French)"
#string STR_MANAGE #language en-US "Manage"
#language fr-FR "Manage(French)"
#string STR_ACCESS_SETUP #language en-US "Access Setup"
#language fr-FR "Access Setup(French)"
#string STR_ACCESS_SETUP_HELP #language en-US "Select Access Setup Option"
#language fr-FR "Selelct Access Setup Option(French)"
#string STR_RESTRICTED #language en-US "Restricted"
#language fr-FR "Restricted(French)"
#string STR_ADMIN #language en-US "Admin"
#language fr-FR "Admin(French)"
#string STR_BOOR_ORDER #language en-US "Access Boot Order"
#language fr-FR "Access Boot Order(French)"
#string STR_BOOT_ORDER_HELP #language en-US "Select Access Boot Order Option"
#language fr-FR "Select Access Boot Order Option(French)"
#string STR_INSERT #language en-US "Insert"
#language fr-FR "Insert(French)"
#string STR_APPEND #language en-US "Append"
#language fr-FR "Append(French)"
#string STR_REPLACE #language en-US "Replace"
#language fr-FR "Replace(French)"
#string STR_NODEFAULT #language en-US "Nodefault"
#language fr-FR "Nodefault(French)"
#string STR_LOAD #language en-US "Load Device Path"
#language fr-FR "Load Device Path(French)"
#string STR_LOAD_HELP #language en-US "Select Permit/Forbid Load Device Path"
#language fr-FR "Select Permit/Forbid Load Device Path(French)"
#string STR_CONNECT #language en-US "Connect Device Path"
#language fr-FR "Connect Device Path(French)"
#string STR_CONNECT_HELP #language en-US "Select Permit/Forbid Connect Device Path"
#language fr-FR "Select Permit/Forbid Connect Device Path(French)"
#string STR_LOAD_PERMIT #language en-US "Permit Load Device Path"
#language fr-FR "Permit Load Device Path(French)"
#string STR_LOAD_PERMIT_HELP #language en-US "Change Permit Load Device Path to Forbid"
#language fr-FR "Change Permit Load Device Path to Forbid(French)"
#string STR_LOAD_FORBID #language en-US "Forbid Load Device Path"
#language fr-FR "Forbid Load Device Path(French)"
#string STR_LOAD_FORBID_HELP #language en-US "Change Forbid Load Device Path to Permit"
#language fr-FR "Change Forbid Load Device Path to Permit(French)"
#string STR_CONNECT_PERMIT #language en-US "Permit Connect Device Path"
#language fr-FR "Permit Connect Device Path(French)"
#string STR_CONNECT_PERMIT_HELP #language en-US "Change Permit Connect Device Path to Forbid"
#language fr-FR "Change Permit Connect Device Path to Forbid(French)"
#string STR_CONNECT_FORBID #language en-US "Forbid Connect Device Path"
#language fr-FR "Forbid Connect Device Path(French)"
#string STR_CONNECT_FORBID_HELP #language en-US "Change Forbid Connect Device Path to Permit"
#language fr-FR "Change Forbid Connect Device Path to Permit(French)"
#string STR_PRESS_KEY_CONTINUE #language en-US "Press ENTER to Continue, Other Key to Cancel ..."
#language fr-FR "Press ENTER to Continue, Other Key to Cancel ...(French)"
#string STR_MOVE_TO_FORBID_LIST #language en-US "Are You Sure to Move It to Forbid List?"
#language fr-FR "Are You Sure to Move It to Forbid List?(French)"
#string STR_MOVE_TO_PERMIT_LIST #language en-US "Are You Sure to Move It to Permit List?"
#language fr-FR "Are You Sure to Move It to Permit List?(French)"
#string STR_STROKE_KEY_CONTINUE #language en-US "Please Press Any Key to Continue ..."
#language fr-FR "Please Press Any Key to Continue ... (French)"
#language fr-FR "Please Press Any Key to Continue ... (French)"
#string STR_CREATE_PROFILE_FAILED #language en-US "Create New User Profile Failed!"
#language fr-FR "Create New User Profile Failed! (French)"
#language fr-FR "Create New User Profile Failed! (French)"
#string STR_CREATE_PROFILE_SUCCESS #language en-US "Create New User Profile Succeed!"
#language fr-FR "Create New User Profile Succeed! (French)"
#language fr-FR "Create New User Profile Succeed! (French)"
#string STR_USER_ALREADY_EXISTED #language en-US "User Name Had Already Existed."
#language fr-FR "User Name Had Already Existed. (French)"
#language fr-FR "User Name Had Already Existed. (French)"
#string STR_GET_USERNAME_FAILED #language en-US "Failed To Get User Name."
#language fr-FR "Failed To Get User Name. (French)"
#language fr-FR "Failed To Get User Name. (French)"

View File

@@ -1,13 +1,13 @@
/** @file
The functions to modify a user profile.
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -127,7 +127,7 @@ GetAllUserInfo (
mUserInfo.CreateDateExist = FALSE;
mUserInfo.UsageDateExist = FALSE;
mUserInfo.UsageCount = 0;
mUserInfo.AccessPolicyLen = 0;
mUserInfo.AccessPolicyModified = FALSE;
if (mUserInfo.AccessPolicy != NULL) {
@@ -140,7 +140,7 @@ GetAllUserInfo (
FreePool (mUserInfo.IdentityPolicy);
mUserInfo.IdentityPolicy = NULL;
}
//
// Allocate user information memory.
//
@@ -149,7 +149,7 @@ GetAllUserInfo (
if (Info == NULL) {
return ;
}
//
// Get each user information.
//
@@ -164,10 +164,10 @@ GetAllUserInfo (
//
InfoSize = MemSize;
Status = mUserManager->GetInfo (
mUserManager,
mModifyUser,
UserInfo,
Info,
mUserManager,
mModifyUser,
UserInfo,
Info,
&InfoSize
);
if (Status == EFI_BUFFER_TOO_SMALL) {
@@ -281,12 +281,12 @@ ResolveDate (
UnicodeSPrint (
Str + StrLen (Str),
DateBufLen,
L"%2d:%2d:%2d",
L"%2d:%2d:%2d",
Date->Hour,
Date->Minute,
Date->Second
);
HiiSetString (mCallbackInfo->HiiHandle, DateId, Str, NULL);
FreePool (Str);
}
@@ -308,7 +308,7 @@ ResolveCount (
{
CHAR16 Count[10];
UnicodeSPrint (Count, 20, L"%d", CountVal);
UnicodeSPrint (Count, 20, L"%d", CountVal);
HiiSetString (mCallbackInfo->HiiHandle, CountId, Count, NULL);
}
@@ -318,7 +318,7 @@ ResolveCount (
Unicode string.
@param[in, out] Source1 On entry, point to a Null-terminated Unicode string.
On exit, point to a new concatenated Unicode string
On exit, point to a new concatenated Unicode string
@param[in] Source2 Pointer to a Null-terminated Unicode string.
**/
@@ -380,9 +380,9 @@ ResolveIdentityPolicy (
EFI_STRING_ID ProvId;
EFI_HII_HANDLE HiiHandle;
EFI_USER_CREDENTIAL2_PROTOCOL *UserCredential;
TmpStr = NULL;
//
// Resolve each policy.
//
@@ -413,10 +413,10 @@ ResolveIdentityPolicy (
case EFI_USER_INFO_IDENTITY_CREDENTIAL_TYPE:
for (Index = 0; Index < mProviderInfo->Count; Index++) {
UserCredential = mProviderInfo->Provider[Index];
if (CompareGuid ((EFI_GUID *) (Identity + 1), &UserCredential->Type)) {
if (CompareGuid ((EFI_GUID *) (Identity + 1), &UserCredential->Type)) {
UserCredential->Title (
UserCredential,
&HiiHandle,
UserCredential,
&HiiHandle,
&ProvId
);
ProvStr = HiiGetString (HiiHandle, ProvId, NULL);
@@ -432,7 +432,7 @@ ResolveIdentityPolicy (
case EFI_USER_INFO_IDENTITY_CREDENTIAL_PROVIDER:
for (Index = 0; Index < mProviderInfo->Count; Index++) {
UserCredential = mProviderInfo->Provider[Index];
if (CompareGuid ((EFI_GUID *) (Identity + 1), &UserCredential->Identifier)) {
if (CompareGuid ((EFI_GUID *) (Identity + 1), &UserCredential->Identifier)) {
UserCredential->Title (
UserCredential,
&HiiHandle,
@@ -466,7 +466,7 @@ ResolveIdentityPolicy (
and access policy.
@param[in] UserIndex The index of the user in display list to modify.
**/
VOID
ModifyUserInfo (
@@ -527,7 +527,7 @@ ModifyUserInfo (
}
UserIndex--;
}
//
// Get user profile information.
//
@@ -541,7 +541,7 @@ ModifyUserInfo (
mUserInfo.UserName,
NULL
);
//
// Update create date.
//
@@ -555,7 +555,7 @@ ModifyUserInfo (
NULL
);
}
//
// Add usage date.
//
@@ -569,12 +569,12 @@ ModifyUserInfo (
NULL
);
}
//
// Add usage count.
//
ResolveCount ((UINT32) mUserInfo.UsageCount, STRING_TOKEN (STR_USAGE_COUNT_VAL));
//
// Add identity policy.
//
@@ -594,7 +594,7 @@ ModifyUserInfo (
KEY_MODIFY_USER | KEY_SELECT_USER | KEY_MODIFY_IP // Question ID
);
}
//
// Add access policy.
//
@@ -643,7 +643,7 @@ ResolveAccessPolicy (
UINT8 *AccessData;
//
// Set default value
// Set default value
//
mAccessInfo.AccessRight = EFI_USER_INFO_ACCESS_ENROLL_SELF;
mAccessInfo.AccessSetup = ACCESS_SETUP_RESTRICTED;
@@ -653,13 +653,13 @@ ResolveAccessPolicy (
mAccessInfo.LoadForbidLen = 0;
mAccessInfo.ConnectPermitLen = 0;
mAccessInfo.ConnectForbidLen = 0;
//
// Get each user access policy.
//
OffSet = 0;
while (OffSet < mUserInfo.AccessPolicyLen) {
CopyMem (&Control, mUserInfo.AccessPolicy + OffSet, sizeof (Control));
CopyMem (&Control, mUserInfo.AccessPolicy + OffSet, sizeof (Control));
ValLen = Control.Size - sizeof (Control);
switch (Control.Type) {
case EFI_USER_INFO_ACCESS_ENROLL_SELF:
@@ -754,7 +754,7 @@ ResolveAccessPolicy (
@param[in] User Handle of the user whose information will be searched.
@param[in] InfoType The user information type to find.
@param[out] UserInfo Points to user information handle found.
@retval EFI_SUCCESS Find the user information successfully.
@retval Others Fail to find the user information.
@@ -784,7 +784,7 @@ FindInfoByType (
if (Info == NULL) {
return EFI_OUT_OF_RESOURCES;
}
//
// Get each user information.
//
@@ -836,7 +836,7 @@ FindInfoByType (
In this form, access right, access setup and access boot order are dynamically
added. Load devicepath and connect devicepath are displayed too.
**/
VOID
ModidyAccessPolicy (
@@ -849,7 +849,7 @@ ModidyAccessPolicy (
EFI_IFR_GUID_LABEL *StartLabel;
EFI_IFR_GUID_LABEL *EndLabel;
VOID *DefaultOpCodeHandle;
//
// Initialize the container for dynamic opcodes.
//
@@ -893,7 +893,7 @@ ModidyAccessPolicy (
ASSERT (OptionsOpCodeHandle != NULL);
DefaultOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (DefaultOpCodeHandle != NULL);
HiiCreateOneOfOptionOpCode (
OptionsOpCodeHandle,
STRING_TOKEN (STR_NORMAL),
@@ -919,12 +919,12 @@ ModidyAccessPolicy (
);
HiiCreateDefaultOpCode (
DefaultOpCodeHandle,
EFI_HII_DEFAULT_CLASS_STANDARD,
EFI_IFR_NUMERIC_SIZE_1,
DefaultOpCodeHandle,
EFI_HII_DEFAULT_CLASS_STANDARD,
EFI_IFR_NUMERIC_SIZE_1,
mAccessInfo.AccessRight
);
HiiCreateOneOfOpCode (
StartOpCodeHandle, // Container for dynamic created opcodes
KEY_MODIFY_USER | KEY_SELECT_USER | KEY_MODIFY_AP | KEY_MODIFY_RIGHT, // Question ID
@@ -948,7 +948,7 @@ ModidyAccessPolicy (
ASSERT (OptionsOpCodeHandle != NULL);
DefaultOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (DefaultOpCodeHandle != NULL);
HiiCreateOneOfOptionOpCode (
OptionsOpCodeHandle,
STRING_TOKEN (STR_RESTRICTED),
@@ -956,7 +956,7 @@ ModidyAccessPolicy (
EFI_IFR_NUMERIC_SIZE_1,
ACCESS_SETUP_RESTRICTED
);
HiiCreateOneOfOptionOpCode (
OptionsOpCodeHandle,
STRING_TOKEN (STR_NORMAL),
@@ -974,11 +974,11 @@ ModidyAccessPolicy (
);
HiiCreateDefaultOpCode (
DefaultOpCodeHandle,
EFI_HII_DEFAULT_CLASS_STANDARD,
EFI_IFR_NUMERIC_SIZE_1,
DefaultOpCodeHandle,
EFI_HII_DEFAULT_CLASS_STANDARD,
EFI_IFR_NUMERIC_SIZE_1,
mAccessInfo.AccessSetup
);
);
HiiCreateOneOfOpCode (
StartOpCodeHandle, // Container for dynamic created opcodes
@@ -994,7 +994,7 @@ ModidyAccessPolicy (
);
HiiFreeOpCodeHandle (DefaultOpCodeHandle);
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
//
// Add boot order one-of-code.
//
@@ -1002,7 +1002,7 @@ ModidyAccessPolicy (
ASSERT (OptionsOpCodeHandle != NULL);
DefaultOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (DefaultOpCodeHandle != NULL);
HiiCreateOneOfOptionOpCode (
OptionsOpCodeHandle,
STRING_TOKEN (STR_INSERT),
@@ -1026,7 +1026,7 @@ ModidyAccessPolicy (
EFI_IFR_NUMERIC_SIZE_4,
EFI_USER_INFO_ACCESS_BOOT_ORDER_REPLACE
);
HiiCreateOneOfOptionOpCode (
OptionsOpCodeHandle,
STRING_TOKEN (STR_NODEFAULT),
@@ -1036,12 +1036,12 @@ ModidyAccessPolicy (
);
HiiCreateDefaultOpCode (
DefaultOpCodeHandle,
EFI_HII_DEFAULT_CLASS_STANDARD,
EFI_IFR_NUMERIC_SIZE_4,
DefaultOpCodeHandle,
EFI_HII_DEFAULT_CLASS_STANDARD,
EFI_IFR_NUMERIC_SIZE_4,
mAccessInfo.AccessBootOrder
);
HiiCreateOneOfOpCode (
StartOpCodeHandle, // Container for dynamic created opcodes
KEY_MODIFY_USER | KEY_SELECT_USER | KEY_MODIFY_AP | KEY_MODIFY_BOOT, // Question ID
@@ -1054,7 +1054,7 @@ ModidyAccessPolicy (
OptionsOpCodeHandle, // Option Opcode list
DefaultOpCodeHandle // Default Opcode
);
HiiFreeOpCodeHandle (DefaultOpCodeHandle);
HiiFreeOpCodeHandle (DefaultOpCodeHandle);
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
//
@@ -1078,7 +1078,7 @@ ModidyAccessPolicy (
@param[in] ValidLen The valid access policy length.
@param[in] ExpandLen The length that is needed to expand.
**/
VOID
ExpandMemory (
@@ -1107,7 +1107,7 @@ ExpandMemory (
/**
Get the username from user input, and update username string in the Hii
Get the username from user input, and update username string in the Hii
database with it.
**/
@@ -1142,7 +1142,7 @@ ModifyUserName (
}
return ;
}
//
// Check whether the username had been used or not.
//
@@ -1178,15 +1178,15 @@ ModifyUserName (
FreePool (Info);
return ;
}
//
// Update username display in the form.
//
CopyMem (mUserInfo.UserName, UserName, Len);
HiiSetString (
mCallbackInfo->HiiHandle,
STRING_TOKEN (STR_USER_NAME_VAL),
mUserInfo.UserName,
mCallbackInfo->HiiHandle,
STRING_TOKEN (STR_USER_NAME_VAL),
mUserInfo.UserName,
NULL
);
@@ -1303,7 +1303,7 @@ ModifyIdentityPolicy (
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
}
//
// Add logical connector Option OpCode.
//
@@ -1345,8 +1345,8 @@ ModifyIdentityPolicy (
// Update identity policy in the form.
//
ResolveIdentityPolicy (
mUserInfo.IdentityPolicy,
mUserInfo.IdentityPolicyLen,
mUserInfo.IdentityPolicy,
mUserInfo.IdentityPolicyLen,
STRING_TOKEN (STR_IDENTIFY_POLICY_VALUE)
);
@@ -1404,7 +1404,7 @@ GetAccessRight (
if (Info == NULL) {
return EFI_OUT_OF_RESOURCES;
}
//
// Get user access information.
//
@@ -1445,7 +1445,7 @@ GetAccessRight (
if (EFI_ERROR (Status)) {
break;
}
//
// Check user information.
//