VirtualBox

Ignore:
Timestamp:
Oct 29, 2015 4:30:44 AM (9 years ago)
Author:
vboxsync
Message:

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProvider.c

    r58459 r58466  
    11/** @file
    22  Password Credential Provider driver implementation.
    3    
     3
    44Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    9898  //
    9999  NewTable = (CREDENTIAL_TABLE *) AllocateZeroPool (
    100                                     sizeof (CREDENTIAL_TABLE) + 
     100                                    sizeof (CREDENTIAL_TABLE) +
    101101                                    (Count - 1) * sizeof (PASSWORD_INFO)
    102102                                    );
    103   ASSERT (NewTable != NULL); 
     103  ASSERT (NewTable != NULL);
    104104
    105105  NewTable->MaxCount    = Count;
     
    110110  //
    111111  CopyMem (
    112     &NewTable->UserInfo, 
    113     &mPwdTable->UserInfo, 
     112    &NewTable->UserInfo,
     113    &mPwdTable->UserInfo,
    114114    mPwdTable->Count * sizeof (PASSWORD_INFO)
    115115    );
     
    123123
    124124  @param[in]  Index     The index of the password in table. If index is found in
    125                         table, update the info, else add the into to table. 
    126   @param[in]  Info      The new password info to add into table.If Info is NULL, 
     125                        table, update the info, else add the into to table.
     126  @param[in]  Info      The new password info to add into table.If Info is NULL,
    127127                        delete the info by Index.
    128128
     
    151151      if (Index != mPwdTable->Count) {
    152152        NewPasswordInfo = &mPwdTable->UserInfo[mPwdTable->Count];
    153       } 
     153      }
    154154    } else {
    155155      //
     
    214214  Var     = NULL;
    215215  Status  = gRT->GetVariable (
    216                    L"PwdCredential", 
    217                    &gPwdCredentialProviderGuid, 
    218                    NULL, 
     216                   L"PwdCredential",
     217                   &gPwdCredentialProviderGuid,
     218                   NULL,
    219219                   &VarSize,
    220220                   Var
     
    226226    }
    227227    Status = gRT->GetVariable (
    228                     L"PwdCredential", 
    229                     &gPwdCredentialProviderGuid, 
    230                     NULL, 
     228                    L"PwdCredential",
     229                    &gPwdCredentialProviderGuid,
     230                    NULL,
    231231                    &VarSize,
    232232                    Var
     
    236236    return Status;
    237237  }
    238  
     238
    239239  //
    240240  // Create the password credential table.
     
    242242  mPwdTable = AllocateZeroPool (
    243243                sizeof (CREDENTIAL_TABLE) - sizeof (PASSWORD_INFO) +
    244                 PASSWORD_TABLE_INC * sizeof (PASSWORD_INFO) + 
     244                PASSWORD_TABLE_INC * sizeof (PASSWORD_INFO) +
    245245                VarSize
    246246                );
     
    270270  @retval      TRUE           Hash the password successfully.
    271271  @retval      FALSE          Failed to hash the password.
    272                  
     272
    273273**/
    274274BOOLEAN
     
    282282  UINTN             HashSize;
    283283  VOID              *Hash;
    284  
     284
    285285  HashSize = Sha1GetContextSize ();
    286286  Hash     = AllocatePool (HashSize);
    287287  ASSERT (Hash != NULL);
    288  
     288
    289289  Status = Sha1Init (Hash);
    290290  if (!Status) {
    291291    goto Done;
    292292  }
    293  
     293
    294294  Status = Sha1Update (Hash, Password, PasswordSize);
    295295  if (!Status) {
    296296    goto Done;
    297297  }
    298  
     298
    299299  Status = Sha1Final (Hash, Credential);
    300  
     300
    301301Done:
    302302  FreePool (Hash);
     
    325325  CHAR16        *QuestionStr;
    326326  CHAR16        *LineStr;
    327  
     327
    328328  PasswordLen = 0;
    329329  while (TRUE) {
     
    346346    FreePool (QuestionStr);
    347347    FreePool (LineStr);
    348    
     348
    349349    //
    350350    // Check key stroke
     
    357357          PasswordLen--;
    358358        }
    359       } else if ((Key.UnicodeChar == CHAR_NULL) || 
    360                  (Key.UnicodeChar == CHAR_TAB) || 
     359      } else if ((Key.UnicodeChar == CHAR_NULL) ||
     360                 (Key.UnicodeChar == CHAR_TAB) ||
    361361                 (Key.UnicodeChar == CHAR_LINEFEED)) {
    362362        continue;
     
    371371    }
    372372  }
    373  
     373
    374374  PasswordLen = PasswordLen * sizeof (CHAR16);
    375375  GenerateCredential (Password, PasswordLen, (UINT8 *)Credential);
     
    392392  UINTN      Index;
    393393  CHAR8      *Pwd;
    394  
     394
    395395  //
    396396  // Check password credential.
     
    412412  Find a user infomation record by the information record type.
    413413
    414   This function searches all user information records of User from beginning 
     414  This function searches all user information records of User from beginning
    415415  until either the information is found, or there are no more user infomation
    416416  records. A match occurs when a Info.InfoType field matches the user information
    417417  record type.
    418418
    419   @param[in]     User      Points to the user profile record to search.                         
     419  @param[in]     User      Points to the user profile record to search.
    420420  @param[in]     InfoType  The infomation type to be searched.
    421421  @param[out]    Info      Points to the user info found, the caller is responsible
    422422                           to free.
    423  
     423
    424424  @retval EFI_SUCCESS      Find the user information successfully.
    425425  @retval Others           Fail to find the user information.
     
    438438  EFI_USER_INFO_HANDLE       UserInfoHandle;
    439439  EFI_USER_MANAGER_PROTOCOL  *UserManager;
    440  
     440
    441441  //
    442442  // Find user information by information type.
     
    501501      *Info = UserInfo;
    502502      return EFI_SUCCESS;
    503     }   
     503    }
    504504  }
    505505
     
    570570      }
    571571      *ActionRequest  = EFI_BROWSER_ACTION_REQUEST_EXIT;
    572     }   
     572    }
    573573    return EFI_SUCCESS;
    574574  }
     
    714714  Enroll a user on a credential provider.
    715715
    716   This function enrolls a user on this credential provider. If the user exists on 
    717   this credential provider, update the user information on this credential provider; 
     716  This function enrolls a user on this credential provider. If the user exists on
     717  this credential provider, update the user information on this credential provider;
    718718  otherwise add the user information on credential provider.
    719  
     719
    720720  @param[in] This                Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL.
    721721  @param[in] User                The user profile to enroll.
    722  
     722
    723723  @retval EFI_SUCCESS            User profile was successfully enrolled.
    724724  @retval EFI_ACCESS_DENIED      Current user profile does not permit enrollment on the
    725725                                 user profile handle. Either the user profile cannot enroll
    726                                  on any user profile or cannot enroll on a user profile 
     726                                 on any user profile or cannot enroll on a user profile
    727727                                 other than the current user profile.
    728728  @retval EFI_UNSUPPORTED        This credential provider does not support enrollment in
     
    731731                                 error.
    732732  @retval EFI_INVALID_PARAMETER  User does not refer to a valid user profile handle.
    733  
     733
    734734**/
    735735EFI_STATUS
     
    767767  }
    768768
    769   CopyMem (PwdInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER)); 
     769  CopyMem (PwdInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER));
    770770  FreePool (UserInfo);
    771771
    772772  //
    773773  // Get password from user.
    774   // 
     774  //
    775775  while (TRUE) {
    776776    //
     
    789789    if (CompareMem (PwdInfo.Password, Password, CREDENTIAL_LEN) == 0) {
    790790      break;
    791     } 
     791    }
    792792
    793793    QuestionStr = GetStringById (STRING_TOKEN (STR_PASSWORD_MISMATCH));
    794     PromptStr   = GetStringById (STRING_TOKEN (STR_INPUT_PASSWORD_AGAIN));   
     794    PromptStr   = GetStringById (STRING_TOKEN (STR_INPUT_PASSWORD_AGAIN));
    795795    CreatePopUp (
    796796      EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
     
    807807  //
    808808  // Check whether User is ever enrolled in the provider.
    809   // 
     809  //
    810810  for (Index = 0; Index < mPwdTable->Count; Index++) {
    811811    UserId = (UINT8 *) &mPwdTable->UserInfo[Index].UserId;
     
    813813      //
    814814      // User already exists, update the password.
    815       //     
     815      //
    816816      break;
    817817    }
    818818  }
    819    
     819
    820820  //
    821821  // Enroll the User to the provider.
     
    835835  This function returns information about the form used when interacting with the
    836836  user during user identification. The form is the first enabled form in the form-set
    837   class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If 
     837  class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
    838838  the user credential provider does not require a form to identify the user, then this
    839839  function should return EFI_NOT_FOUND.
     
    843843  @param[out] FormSetId  On return, holds the identifier of the form set which contains
    844844                         the form used during user identification.
    845   @param[out] FormId     On return, holds the identifier of the form used during user 
     845  @param[out] FormId     On return, holds the identifier of the form used during user
    846846                         identification.
    847                          
     847
    848848  @retval EFI_SUCCESS            Form returned successfully.
    849849  @retval EFI_NOT_FOUND          Form not returned.
    850850  @retval EFI_INVALID_PARAMETER  Hii is NULL or FormSetId is NULL or FormId is NULL.
    851  
     851
    852852**/
    853853EFI_STATUS
     
    860860  )
    861861{
    862   if ((This == NULL) || (Hii == NULL) || 
     862  if ((This == NULL) || (Hii == NULL) ||
    863863      (FormSetId == NULL) || (FormId == NULL)) {
    864864    return EFI_INVALID_PARAMETER;
     
    868868  *FormId    = FORMID_GET_PASSWORD_FORM;
    869869  CopyGuid (FormSetId, &gPwdCredentialProviderGuid);
    870  
     870
    871871  return EFI_SUCCESS;
    872872}
     
    878878  This optional function returns a bitmap that is less than or equal to the number
    879879  of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND
    880   is returned. 
     880  is returned.
    881881
    882882  @param[in]      This    Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    883   @param[in, out] Width   On entry, points to the desired bitmap width. If NULL then no 
    884                           bitmap information will be returned. On exit, points to the 
     883  @param[in, out] Width   On entry, points to the desired bitmap width. If NULL then no
     884                          bitmap information will be returned. On exit, points to the
    885885                          width of the bitmap returned.
    886886  @param[in, out] Height  On entry, points to the desired bitmap height. If NULL then no
    887                           bitmap information will be returned. On exit, points to the 
     887                          bitmap information will be returned. On exit, points to the
    888888                          height of the bitmap returned
    889   @param[out]     Hii     On return, holds the HII database handle. 
    890   @param[out]     Image   On return, holds the HII image identifier. 
    891  
     889  @param[out]     Hii     On return, holds the HII database handle.
     890  @param[out]     Image   On return, holds the HII image identifier.
     891
    892892  @retval EFI_SUCCESS            Image identifier returned successfully.
    893893  @retval EFI_NOT_FOUND          Image identifier not returned.
    894894  @retval EFI_INVALID_PARAMETER  Hii is NULL or Image is NULL.
    895  
     895
    896896**/
    897897EFI_STATUS
     
    904904      OUT    EFI_IMAGE_ID                        *Image
    905905  )
    906 { 
     906{
    907907  if ((This == NULL) || (Hii == NULL) || (Image == NULL)) {
    908908    return EFI_INVALID_PARAMETER;
     
    916916
    917917  This function returns a string which describes the credential provider. If no
    918   such string exists, then EFI_NOT_FOUND is returned. 
     918  such string exists, then EFI_NOT_FOUND is returned.
    919919
    920920  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    921921  @param[out] Hii        On return, holds the HII database handle.
    922922  @param[out] String     On return, holds the HII string identifier.
    923  
     923
    924924  @retval EFI_SUCCESS            String identifier returned successfully.
    925925  @retval EFI_NOT_FOUND          String identifier not returned.
    926926  @retval EFI_INVALID_PARAMETER  Hii is NULL or String is NULL.
    927  
     927
    928928**/
    929929EFI_STATUS
     
    938938    return EFI_INVALID_PARAMETER;
    939939  }
    940  
     940
    941941  //
    942942  // Set Hii handle and String ID.
     
    953953
    954954  This function returns the user identifier of the user authenticated by this credential
    955   provider. This function is called after the credential-related information has been 
     955  provider. This function is called after the credential-related information has been
    956956  submitted on a form, OR after a call to Default() has returned that this credential is
    957957  ready to log on.
    958958
    959959  @param[in]  This           Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    960   @param[in]  User           The user profile handle of the user profile currently being 
     960  @param[in]  User           The user profile handle of the user profile currently being
    961961                             considered by the user identity manager. If NULL, then no user
    962962                             profile is currently under consideration.
    963   @param[out] Identifier     On return, points to the user identifier. 
    964  
     963  @param[out] Identifier     On return, points to the user identifier.
     964
    965965  @retval EFI_SUCCESS            User identifier returned successfully.
    966966  @retval EFI_NOT_READY          No user identifier can be returned.
     
    969969  @retval EFI_NOT_FOUND          User is not NULL, and the specified user handle can't be
    970970                                 found in user profile database
    971  
     971
    972972**/
    973973EFI_STATUS
     
    998998    return EFI_NOT_READY;
    999999  }
    1000  
     1000
    10011001  if (User == NULL) {
    10021002    //
    10031003    // Return the user ID whose password matches the input password.
    1004     // 
     1004    //
    10051005    CopyMem (
    1006       Identifier, 
    1007       &mPwdTable->UserInfo[mPwdTable->ValidIndex - 1].UserId, 
     1006      Identifier,
     1007      &mPwdTable->UserInfo[mPwdTable->ValidIndex - 1].UserId,
    10081008      sizeof (EFI_USER_INFO_IDENTIFIER)
    1009       );   
     1009      );
    10101010    return EFI_SUCCESS;
    10111011  }
    1012  
     1012
    10131013  //
    10141014  // Get the User's ID.
     
    10221022    return EFI_NOT_FOUND;
    10231023  }
    1024  
     1024
    10251025  //
    10261026  // Check whether the input password matches one in PwdTable.
     
    10361036        FreePool (UserInfo);
    10371037        return EFI_SUCCESS;
    1038       } 
    1039     }
    1040   }
    1041 
    1042   FreePool (UserInfo); 
     1038      }
     1039    }
     1040  }
     1041
     1042  FreePool (UserInfo);
    10431043  return EFI_NOT_READY;
    10441044}
     
    10481048  Indicate that user interface interaction has begun for the specified credential.
    10491049
    1050   This function is called when a credential provider is selected by the user. If 
     1050  This function is called when a credential provider is selected by the user. If
    10511051  AutoLogon returns FALSE, then the user interface will be constructed by the User
    1052   Identity Manager. 
     1052  Identity Manager.
    10531053
    10541054  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    1055   @param[out] AutoLogon  On return, points to the credential provider's capabilities 
    1056                          after the credential provider has been selected by the user. 
    1057  
     1055  @param[out] AutoLogon  On return, points to the credential provider's capabilities
     1056                         after the credential provider has been selected by the user.
     1057
    10581058  @retval EFI_SUCCESS            Credential provider successfully selected.
    10591059  @retval EFI_INVALID_PARAMETER  AutoLogon is NULL.
    1060  
     1060
    10611061**/
    10621062EFI_STATUS
     
    10821082
    10831083  @param[in] This        Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    1084  
     1084
    10851085  @retval EFI_SUCCESS    Credential provider successfully deselected.
    1086  
     1086
    10871087**/
    10881088EFI_STATUS
     
    11021102  Return the default logon behavior for this user credential.
    11031103
    1104   This function reports the default login behavior regarding this credential provider. 
     1104  This function reports the default login behavior regarding this credential provider.
    11051105
    11061106  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    11071107  @param[out] AutoLogon  On return, holds whether the credential provider should be used
    1108                          by default to automatically log on the user. 
    1109  
     1108                         by default to automatically log on the user.
     1109
    11101110  @retval EFI_SUCCESS            Default information successfully returned.
    11111111  @retval EFI_INVALID_PARAMETER  AutoLogon is NULL.
    1112  
     1112
    11131113**/
    11141114EFI_STATUS
     
    11231123  }
    11241124  *AutoLogon = 0;
    1125  
     1125
    11261126  return EFI_SUCCESS;
    11271127}
     
    11311131  Return information attached to the credential provider.
    11321132
    1133   This function returns user information. 
     1133  This function returns user information.
    11341134
    11351135  @param[in]      This          Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    1136   @param[in]      UserInfo      Handle of the user information data record. 
     1136  @param[in]      UserInfo      Handle of the user information data record.
    11371137  @param[out]     Info          On entry, points to a buffer of at least *InfoSize bytes. On
    11381138                                exit, holds the user information. If the buffer is too small
     
    11401140                                and InfoSize is updated to contain the number of bytes actually
    11411141                                required.
    1142   @param[in, out] InfoSize      On entry, points to the size of Info. On return, points to the 
    1143                                 size of the user information. 
    1144  
     1142  @param[in, out] InfoSize      On entry, points to the size of Info. On return, points to the
     1143                                size of the user information.
     1144
    11451145  @retval EFI_SUCCESS           Information returned successfully.
    11461146  @retval EFI_BUFFER_TOO_SMALL  The size specified by InfoSize is too small to hold all of the
    11471147                                user information. The size required is returned in *InfoSize.
    11481148  @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
    1149   @retval EFI_NOT_FOUND         The specified UserInfo does not refer to a valid user info handle. 
    1150                                
     1149  @retval EFI_NOT_FOUND         The specified UserInfo does not refer to a valid user info handle.
     1150
    11511151**/
    11521152EFI_STATUS
     
    11611161  EFI_USER_INFO            *CredentialInfo;
    11621162  UINTN                    Index;
    1163  
     1163
    11641164  if ((This == NULL) || (InfoSize == NULL) || (Info == NULL)) {
    11651165    return EFI_INVALID_PARAMETER;
     
    11691169    return EFI_NOT_FOUND;
    11701170  }
    1171  
     1171
    11721172  //
    11731173  // Find information handle in credential info table.
     
    11831183        return EFI_BUFFER_TOO_SMALL;
    11841184      }
    1185       CopyMem (Info, CredentialInfo, CredentialInfo->InfoSize);     
    1186       return EFI_SUCCESS; 
    1187     }
    1188   }
    1189  
     1185      CopyMem (Info, CredentialInfo, CredentialInfo->InfoSize);
     1186      return EFI_SUCCESS;
     1187    }
     1188  }
     1189
    11901190  return EFI_NOT_FOUND;
    11911191}
     
    11981198  information record handle, point UserInfo at a NULL. Each subsequent call will retrieve
    11991199  another user information record handle until there are no more, at which point UserInfo
    1200   will point to NULL. 
     1200  will point to NULL.
    12011201
    12021202  @param[in]      This     Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
     
    12041204                           to start enumeration. On exit, points to the next user information
    12051205                           handle or NULL if there is no more user information.
    1206  
     1206
    12071207  @retval EFI_SUCCESS            User information returned.
    12081208  @retval EFI_NOT_FOUND          No more user information found.
    12091209  @retval EFI_INVALID_PARAMETER  UserInfo is NULL.
    1210  
     1210
    12111211**/
    12121212EFI_STATUS
     
    12221222  UINTN                    Index;
    12231223  UINTN                    ProvStrLen;
    1224    
     1224
    12251225  if ((This == NULL) || (UserInfo == NULL)) {
    12261226    return EFI_INVALID_PARAMETER;
     
    12441244    Info    = AllocateZeroPool (InfoLen);
    12451245    ASSERT (Info != NULL);
    1246    
     1246
    12471247    Info->InfoType    = EFI_USER_INFO_CREDENTIAL_PROVIDER_RECORD;
    12481248    Info->InfoSize    = (UINT32) InfoLen;
     
    12501250    CopyGuid (&Info->Credential, &gPwdCredentialProviderGuid);
    12511251    CopyGuid ((EFI_GUID *)(Info + 1), &gPwdCredentialProviderGuid);
    1252    
     1252
    12531253    mPwdInfoHandle->Info[0] = Info;
    12541254    mPwdInfoHandle->Count++;
     
    12621262    Info        = AllocateZeroPool (InfoLen);
    12631263    ASSERT (Info != NULL);
    1264    
     1264
    12651265    Info->InfoType    = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD;
    12661266    Info->InfoSize    = (UINT32) InfoLen;
     
    12791279    Info    = AllocateZeroPool (InfoLen);
    12801280    ASSERT (Info != NULL);
    1281      
     1281
    12821282    Info->InfoType    = EFI_USER_INFO_CREDENTIAL_TYPE_RECORD;
    12831283    Info->InfoSize    = (UINT32) InfoLen;
     
    12851285    CopyGuid (&Info->Credential, &gPwdCredentialProviderGuid);
    12861286    CopyGuid ((EFI_GUID *)(Info + 1), &gEfiUserCredentialClassPasswordGuid);
    1287    
     1287
    12881288    mPwdInfoHandle->Info[2] = Info;
    12891289    mPwdInfoHandle->Count++;
    1290  
     1290
    12911291    //
    12921292    // The fourth information, Credential Provider type name info.
     
    12971297    Info        = AllocateZeroPool (InfoLen);
    12981298    ASSERT (Info != NULL);
    1299    
     1299
    13001300    Info->InfoType    = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD;
    13011301    Info->InfoSize    = (UINT32) InfoLen;
     
    13041304    CopyMem ((UINT8*)(Info + 1), ProvNameStr, ProvStrLen);
    13051305    FreePool (ProvNameStr);
    1306    
     1306
    13071307    mPwdInfoHandle->Info[3] = Info;
    13081308    mPwdInfoHandle->Count++;
    13091309  }
    1310  
     1310
    13111311  if (*UserInfo == NULL) {
    13121312    //
     
    13161316    return EFI_SUCCESS;
    13171317  }
    1318  
     1318
    13191319  //
    13201320  // Find information handle in credential info table.
     
    13331333        return EFI_NOT_FOUND;
    13341334      }
    1335    
     1335
    13361336      Index++;
    13371337      *UserInfo = (EFI_USER_INFO_HANDLE)mPwdInfoHandle->Info[Index];
    1338       return EFI_SUCCESS;           
     1338      return EFI_SUCCESS;
    13391339    }
    13401340  }
     
    13471347  Delete a user on this credential provider.
    13481348
    1349   This function deletes a user on this credential provider. 
     1349  This function deletes a user on this credential provider.
    13501350
    13511351  @param[in]     This            Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
     
    13531353
    13541354  @retval EFI_SUCCESS            User profile was successfully deleted.
    1355   @retval EFI_ACCESS_DENIED      Current user profile does not permit deletion on the user profile handle. 
    1356                                  Either the user profile cannot delete on any user profile or cannot delete 
    1357                                  on a user profile other than the current user profile. 
     1355  @retval EFI_ACCESS_DENIED      Current user profile does not permit deletion on the user profile handle.
     1356                                 Either the user profile cannot delete on any user profile or cannot delete
     1357                                 on a user profile other than the current user profile.
    13581358  @retval EFI_UNSUPPORTED        This credential provider does not support deletion in the pre-OS.
    13591359  @retval EFI_DEVICE_ERROR       The new credential could not be deleted because of a device error.
     
    13721372  UINT8                     *NewUserId;
    13731373  UINTN                     Index;
    1374  
     1374
    13751375  if ((This == NULL) || (User == NULL)) {
    13761376    return EFI_INVALID_PARAMETER;
     
    13921392  //
    13931393  // Find the user by user identifier in mPwdTable.
    1394   // 
     1394  //
    13951395  for (Index = 0; Index < mPwdTable->Count; Index++) {
    13961396    UserId    = (UINT8 *) &mPwdTable->UserInfo[Index].UserId;
     
    14401440    return Status;
    14411441  }
    1442  
     1442
    14431443  //
    14441444  // Init Form Browser.
     
    14481448    return Status;
    14491449  }
    1450  
     1450
    14511451  //
    14521452  // Install protocol interfaces for the password credential provider.
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProvider.h

    r48674 r58466  
    11/** @file
    22  Password Credential Provider driver header file.
    3    
     3
    44Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    9393  Enroll a user on a credential provider.
    9494
    95   This function enrolls a user on this credential provider. If the user exists on 
    96   this credential provider, update the user information on this credential provider; 
     95  This function enrolls a user on this credential provider. If the user exists on
     96  this credential provider, update the user information on this credential provider;
    9797  otherwise delete the user information on credential provider.
    98  
     98
    9999  @param[in] This                Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL.
    100100  @param[in] User                The user profile to enroll.
    101  
     101
    102102  @retval EFI_SUCCESS            User profile was successfully enrolled.
    103103  @retval EFI_ACCESS_DENIED      Current user profile does not permit enrollment on the
    104104                                 user profile handle. Either the user profile cannot enroll
    105                                  on any user profile or cannot enroll on a user profile 
     105                                 on any user profile or cannot enroll on a user profile
    106106                                 other than the current user profile.
    107107  @retval EFI_UNSUPPORTED        This credential provider does not support enrollment in
     
    110110                                 error.
    111111  @retval EFI_INVALID_PARAMETER  User does not refer to a valid user profile handle.
    112  
     112
    113113**/
    114114EFI_STATUS
     
    124124  This function returns information about the form used when interacting with the
    125125  user during user identification. The form is the first enabled form in the form-set
    126   class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If 
     126  class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
    127127  the user credential provider does not require a form to identify the user, then this
    128128  function should return EFI_NOT_FOUND.
     
    132132  @param[out] FormSetId  On return, holds the identifier of the form set which contains
    133133                         the form used during user identification.
    134   @param[out] FormId     On return, holds the identifier of the form used during user 
     134  @param[out] FormId     On return, holds the identifier of the form used during user
    135135                         identification.
    136                          
     136
    137137  @retval EFI_SUCCESS            Form returned successfully.
    138138  @retval EFI_NOT_FOUND          Form not returned.
    139139  @retval EFI_INVALID_PARAMETER  Hii is NULL or FormSetId is NULL or FormId is NULL.
    140  
     140
    141141**/
    142142EFI_STATUS
     
    154154  This optional function returns a bitmap which is less than or equal to the number
    155155  of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND
    156   is returned. 
     156  is returned.
    157157
    158158  @param[in]      This    Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    159   @param[in, out] Width   On entry, points to the desired bitmap width. If NULL then no 
    160                           bitmap information will be returned. On exit, points to the 
     159  @param[in, out] Width   On entry, points to the desired bitmap width. If NULL then no
     160                          bitmap information will be returned. On exit, points to the
    161161                          width of the bitmap returned.
    162162  @param[in, out] Height  On entry, points to the desired bitmap height. If NULL then no
    163                           bitmap information will be returned. On exit, points to the 
     163                          bitmap information will be returned. On exit, points to the
    164164                          height of the bitmap returned
    165   @param[out]     Hii     On return, holds the HII database handle. 
    166   @param[out]     Image   On return, holds the HII image identifier. 
    167  
     165  @param[out]     Hii     On return, holds the HII database handle.
     166  @param[out]     Image   On return, holds the HII image identifier.
     167
    168168  @retval EFI_SUCCESS            Image identifier returned successfully.
    169169  @retval EFI_NOT_FOUND          Image identifier not returned.
    170170  @retval EFI_INVALID_PARAMETER  Hii is NULL or Image is NULL.
    171  
     171
    172172**/
    173173EFI_STATUS
     
    185185
    186186  This function returns a string which describes the credential provider. If no
    187   such string exists, then EFI_NOT_FOUND is returned. 
     187  such string exists, then EFI_NOT_FOUND is returned.
    188188
    189189  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    190190  @param[out] Hii        On return, holds the HII database handle.
    191191  @param[out] String     On return, holds the HII string identifier.
    192  
     192
    193193  @retval EFI_SUCCESS            String identifier returned successfully.
    194194  @retval EFI_NOT_FOUND          String identifier not returned.
    195195  @retval EFI_INVALID_PARAMETER  Hii is NULL or String is NULL.
    196  
     196
    197197**/
    198198EFI_STATUS
     
    208208
    209209  This function returns the user identifier of the user authenticated by this credential
    210   provider. This function is called after the credential-related information has been 
     210  provider. This function is called after the credential-related information has been
    211211  submitted on a form OR after a call to Default() has returned that this credential is
    212212  ready to log on.
    213213
    214214  @param[in]  This           Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    215   @param[in]  User           The user profile handle of the user profile currently being 
     215  @param[in]  User           The user profile handle of the user profile currently being
    216216                             considered by the user identity manager. If NULL, then no user
    217217                             profile is currently under consideration.
    218   @param[out] Identifier     On return, points to the user identifier. 
    219  
     218  @param[out] Identifier     On return, points to the user identifier.
     219
    220220  @retval EFI_SUCCESS            User identifier returned successfully.
    221221  @retval EFI_NOT_READY          No user identifier can be returned.
     
    224224  @retval EFI_NOT_FOUND          User is not NULL, and the specified user handle can't be
    225225                                 found in user profile database
    226  
     226
    227227**/
    228228EFI_STATUS
     
    237237  Indicate that user interface interaction has begun for the specified credential.
    238238
    239   This function is called when a credential provider is selected by the user. If 
     239  This function is called when a credential provider is selected by the user. If
    240240  AutoLogon returns FALSE, then the user interface will be constructed by the User
    241   Identity Manager. 
     241  Identity Manager.
    242242
    243243  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    244   @param[out] AutoLogon  On return, points to the credential provider's capabilities 
    245                          after the credential provider has been selected by the user. 
    246  
     244  @param[out] AutoLogon  On return, points to the credential provider's capabilities
     245                         after the credential provider has been selected by the user.
     246
    247247  @retval EFI_SUCCESS            Credential provider successfully selected.
    248248  @retval EFI_INVALID_PARAMETER  AutoLogon is NULL.
    249  
     249
    250250**/
    251251EFI_STATUS
     
    262262
    263263  @param[in] This        Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    264  
     264
    265265  @retval EFI_SUCCESS    Credential provider successfully deselected.
    266  
     266
    267267**/
    268268EFI_STATUS
     
    275275  Return the default logon behavior for this user credential.
    276276
    277   This function reports the default login behavior regarding this credential provider. 
     277  This function reports the default login behavior regarding this credential provider.
    278278
    279279  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    280280  @param[out] AutoLogon  On return, holds whether the credential provider should be used
    281                          by default to automatically log on the user. 
    282  
     281                         by default to automatically log on the user.
     282
    283283  @retval EFI_SUCCESS            Default information successfully returned.
    284284  @retval EFI_INVALID_PARAMETER  AutoLogon is NULL.
     
    295295  Return information attached to the credential provider.
    296296
    297   This function returns user information. 
     297  This function returns user information.
    298298
    299299  @param[in]      This          Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    300   @param[in]      UserInfo      Handle of the user information data record. 
     300  @param[in]      UserInfo      Handle of the user information data record.
    301301  @param[out]     Info          On entry, points to a buffer of at least *InfoSize bytes. On
    302302                                exit, holds the user information. If the buffer is too small
     
    304304                                and InfoSize is updated to contain the number of bytes actually
    305305                                required.
    306   @param[in, out] InfoSize      On entry, points to the size of Info. On return, points to the 
    307                                 size of the user information. 
    308  
     306  @param[in, out] InfoSize      On entry, points to the size of Info. On return, points to the
     307                                size of the user information.
     308
    309309  @retval EFI_SUCCESS           Information returned successfully.
    310310  @retval EFI_BUFFER_TOO_SMALL  The size specified by InfoSize is too small to hold all of the
    311311                                user information. The size required is returned in *InfoSize.
    312312  @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
    313   @retval EFI_NOT_FOUND         The specified UserInfo does not refer to a valid user info handle. 
    314                                
     313  @retval EFI_NOT_FOUND         The specified UserInfo does not refer to a valid user info handle.
     314
    315315**/
    316316EFI_STATUS
     
    330330  information record handle, point UserInfo at a NULL. Each subsequent call will retrieve
    331331  another user information record handle until there are no more, at which point UserInfo
    332   will point to NULL. 
     332  will point to NULL.
    333333
    334334  @param[in]      This     Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
     
    336336                           to start enumeration. On exit, points to the next user information
    337337                           handle or NULL if there is no more user information.
    338  
     338
    339339  @retval EFI_SUCCESS            User information returned.
    340340  @retval EFI_NOT_FOUND          No more user information found.
    341341  @retval EFI_INVALID_PARAMETER  UserInfo is NULL.
    342  
     342
    343343**/
    344344EFI_STATUS
     
    352352  Delete a user on this credential provider.
    353353
    354   This function deletes a user on this credential provider. 
     354  This function deletes a user on this credential provider.
    355355
    356356  @param[in]     This            Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
     
    358358
    359359  @retval EFI_SUCCESS            User profile was successfully deleted.
    360   @retval EFI_ACCESS_DENIED      Current user profile does not permit deletion on the user profile handle. 
    361                                  Either the user profile cannot delete on any user profile or cannot delete 
    362                                  on a user profile other than the current user profile. 
     360  @retval EFI_ACCESS_DENIED      Current user profile does not permit deletion on the user profile handle.
     361                                 Either the user profile cannot delete on any user profile or cannot delete
     362                                 on a user profile other than the current user profile.
    363363  @retval EFI_UNSUPPORTED        This credential provider does not support deletion in the pre-OS.
    364364  @retval EFI_DEVICE_ERROR       The new credential could not be deleted because of a device error.
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProviderData.h

    r48674 r58466  
    11/** @file
    22  Data structure used by the Password Credential Provider driver.
    3    
     3
    44Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    2525//
    2626// Key defination
    27 // 
     27//
    2828#define KEY_GET_PASSWORD              0x1000
    2929
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProviderDxe.inf

    r58459 r58466  
    4545  UefiLib
    4646  BaseCryptLib
    47  
     47
    4848[Guids]
    4949  gEfiUserCredentialClassPasswordGuid           ## SOMETIMES_CONSUMES          ## GUID
    50  
     50
    5151  ## PRODUCES             ## Variable:L"PwdCredential"
    5252  ## CONSUMES             ## Variable:L"PwdCredential"
     
    5454  ## SOMETIMES_CONSUMES   ## GUID               #  The credential provider identifier
    5555  gPwdCredentialProviderGuid
    56  
     56
    5757[Protocols]
    5858  gEfiDevicePathProtocolGuid                    ## PRODUCES
     
    6060  gEfiUserCredential2ProtocolGuid               ## PRODUCES
    6161  gEfiUserManagerProtocolGuid                   ## SOMETIMES_CONSUMES
    62  
     62
    6363[UserExtensions.TianoCore."ExtraFiles"]
    6464  PwdCredentialProviderExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProviderStrings.uni

    • Property svn:mime-type changed from application/octet-stream to text/plain;encoding=UTF-16LE
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProviderVfr.Vfr

    • Property svn:eol-style set to native
    r58459 r58466  
    33
    44Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    1515#include "PwdCredentialProviderData.h"
    1616
    17 formset 
     17formset
    1818  guid      = PWD_CREDENTIAL_PROVIDER_GUID,
    19   title     = STRING_TOKEN(STR_CREDENTIAL_TITLE), 
    20   help      = STRING_TOKEN(STR_NULL_STRING), 
     19  title     = STRING_TOKEN(STR_CREDENTIAL_TITLE),
     20  help      = STRING_TOKEN(STR_NULL_STRING),
    2121  classguid = PWD_CREDENTIAL_PROVIDER_GUID,
    22  
    23   form formid = FORMID_GET_PASSWORD_FORM,           
     22
     23  form formid = FORMID_GET_PASSWORD_FORM,
    2424    title = STRING_TOKEN(STR_FORM_TITLE);
    25    
    26     text 
    27       help   = STRING_TOKEN(STR_NULL_STRING), 
     25
     26    text
     27      help   = STRING_TOKEN(STR_NULL_STRING),
    2828      text   = STRING_TOKEN(STR_INPUT_PASSWORD),
    2929      flags  = INTERACTIVE,
     
    3131
    3232  endform;
    33  
     33
    3434endformset;
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProvider.c

    r58459 r58466  
    11/** @file
    22  Usb Credential Provider driver implemenetation.
    3    
     3
    44Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    7979               Count * sizeof (USB_INFO)
    8080               );
    81   ASSERT (NewTable != NULL); 
     81  ASSERT (NewTable != NULL);
    8282
    8383  NewTable->MaxCount = Count;
     
    8888  //
    8989  CopyMem (
    90     &NewTable->UserInfo, 
    91     &mUsbTable->UserInfo, 
     90    &NewTable->UserInfo,
     91    &mUsbTable->UserInfo,
    9292    mUsbTable->Count * sizeof (USB_INFO)
    9393    );
     
    101101
    102102  @param[in]  Index     The index of the password in table. If index is found in
    103                         table, update the info, else add the into to table. 
    104   @param[in]  Info      The new credential info to add into table. If Info is NULL, 
     103                        table, update the info, else add the into to table.
     104  @param[in]  Info      The new credential info to add into table. If Info is NULL,
    105105                        delete the info by Index.
    106106
     
    118118  EFI_STATUS  Status;
    119119  USB_INFO    *NewUsbInfo;
    120  
     120
    121121  NewUsbInfo = NULL;
    122122  if (Index < mUsbTable->Count) {
     
    128128      if (Index != mUsbTable->Count) {
    129129        NewUsbInfo = &mUsbTable->UserInfo[mUsbTable->Count];
    130       } 
     130      }
    131131    } else {
    132132      //
     
    191191  Var     = NULL;
    192192  Status  = gRT->GetVariable (
    193                    L"UsbCredential", 
    194                    &gUsbCredentialProviderGuid, 
    195                    NULL, 
     193                   L"UsbCredential",
     194                   &gUsbCredentialProviderGuid,
     195                   NULL,
    196196                   &VarSize,
    197197                   Var
     
    203203    }
    204204    Status = gRT->GetVariable (
    205                     L"UsbCredential", 
    206                     &gUsbCredentialProviderGuid, 
    207                     NULL, 
     205                    L"UsbCredential",
     206                    &gUsbCredentialProviderGuid,
     207                    NULL,
    208208                    &VarSize,
    209209                    Var
     
    213213    return Status;
    214214  }
    215  
     215
    216216  //
    217217  // Init Usb credential table.
     
    219219  mUsbTable = AllocateZeroPool (
    220220                sizeof (CREDENTIAL_TABLE) - sizeof (USB_INFO) +
    221                 USB_TABLE_INC * sizeof (USB_INFO) + 
     221                USB_TABLE_INC * sizeof (USB_INFO) +
    222222                VarSize
    223223                );
     
    307307        continue;
    308308      }
    309    
     309
    310310      Status = SimpleFileSystem->OpenVolume (
    311311                                   SimpleFileSystem,
     
    315315        continue;
    316316      }
    317                                    
     317
    318318      Status = RootFs->Open (
    319319                         RootFs,
     
    325325      if (!EFI_ERROR (Status)) {
    326326        break;
    327       }     
     327      }
    328328    }
    329329  }
     
    336336    goto Done;
    337337  }
    338  
     338
    339339  //
    340340  // Figure out how big the file is.
     
    353353  }
    354354
    355   FileInfo = AllocateZeroPool (ScratchBufferSize);                                   
     355  FileInfo = AllocateZeroPool (ScratchBufferSize);
    356356  if (FileInfo == NULL) {
    357357    DEBUG ((DEBUG_ERROR, "Can not allocate enough memory for the token file!\n"));
     
    371371    goto Done;
    372372  }
    373  
     373
    374374  //
    375375  // Allocate a buffer for the file.
    376376  //
    377377  *BufferSize = (UINT32) FileInfo->FileSize;
    378   *Buffer     = AllocateZeroPool (*BufferSize); 
     378  *Buffer     = AllocateZeroPool (*BufferSize);
    379379  if (*Buffer == NULL) {
    380380    DEBUG ((DEBUG_ERROR, "Can not allocate a buffer for the file!\n"));
     
    382382    goto Done;
    383383  }
    384  
     384
    385385  //
    386386  // Load file into the allocated memory.
     
    393393    goto Done;
    394394  }
    395  
     395
    396396  //
    397397  // Close file.
     
    417417  Hash the data to get credential.
    418418
    419   @param[in]   Buffer         Points to the data buffer 
     419  @param[in]   Buffer         Points to the data buffer
    420420  @param[in]   BufferSize     The size of data in buffer, in bytes.
    421421  @param[out]  Credential     Points to the hashed result
     
    423423  @retval      TRUE           Hash the data successfully.
    424424  @retval      FALSE          Failed to hash the data.
    425                  
     425
    426426**/
    427427BOOLEAN
     
    435435  UINTN             HashSize;
    436436  VOID              *Hash;
    437  
     437
    438438  HashSize = Sha1GetContextSize ();
    439439  Hash     = AllocatePool (HashSize);
    440440  ASSERT (Hash != NULL);
    441  
     441
    442442  Status = Sha1Init (Hash);
    443443  if (!Status) {
    444444    goto Done;
    445445  }
    446  
     446
    447447  Status = Sha1Update (Hash, Buffer, BufferSize);
    448448  if (!Status) {
    449449    goto Done;
    450450  }
    451  
     451
    452452  Status = Sha1Final (Hash, Credential);
    453  
     453
    454454Done:
    455455  FreePool (Hash);
     
    465465  @retval EFI_SUCCESS           Read a Token successfully.
    466466  @retval Others                Fails to read a Token.
    467  
     467
    468468**/
    469469EFI_STATUS
     
    485485    return Status;
    486486  }
    487  
     487
    488488  if (!GenerateCredential (Buffer, BufSize, Token)) {
    489489    DEBUG ((DEBUG_ERROR, "Generate credential from read data failed!\n"));
     
    491491    return EFI_SECURITY_VIOLATION;
    492492  }
    493  
    494   FreePool (Buffer); 
     493
     494  FreePool (Buffer);
    495495  return EFI_SUCCESS;
    496496}
     
    500500  Find a user infomation record by the information record type.
    501501
    502   This function searches all user information records of User from beginning 
     502  This function searches all user information records of User from beginning
    503503  until either the information is found or there are no more user infomation
    504504  record. A match occurs when a Info.InfoType field matches the user information
    505505  record type.
    506506
    507   @param[in]     User      Points to the user profile record to search.                         
     507  @param[in]     User      Points to the user profile record to search.
    508508  @param[in]     InfoType  The infomation type to be searched.
    509509  @param[out]    Info      Points to the user info found, the caller is responsible
    510510                           to free.
    511  
     511
    512512  @retval EFI_SUCCESS      Find the user information successfully.
    513513  @retval Others           Fail to find the user information.
     
    526526  EFI_USER_INFO_HANDLE       UserInfoHandle;
    527527  EFI_USER_MANAGER_PROTOCOL  *UserManager;
    528  
     528
    529529  //
    530530  // Find user information by information type.
     
    589589      *Info = UserInfo;
    590590      return EFI_SUCCESS;
    591     }   
     591    }
    592592  }
    593593
     
    612612{
    613613  USB_PROVIDER_CALLBACK_INFO  *CallbackInfo;
    614    
     614
    615615  //
    616616  // Initialize driver private data.
     
    620620    return EFI_OUT_OF_RESOURCES;
    621621  }
    622  
     622
    623623  CallbackInfo->DriverHandle  = NULL;
    624624
     
    644644  Enroll a user on a credential provider.
    645645
    646   This function enrolls a user on this credential provider. If the user exists on 
    647   this credential provider, update the user information on this credential provider; 
     646  This function enrolls a user on this credential provider. If the user exists on
     647  this credential provider, update the user information on this credential provider;
    648648  otherwise add the user information on credential provider.
    649  
     649
    650650  @param[in] This                Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL.
    651651  @param[in] User                The user profile to enroll.
    652  
     652
    653653  @retval EFI_SUCCESS            User profile was successfully enrolled.
    654654  @retval EFI_ACCESS_DENIED      Current user profile does not permit enrollment on the
    655655                                 user profile handle. Either the user profile cannot enroll
    656                                  on any user profile or cannot enroll on a user profile 
     656                                 on any user profile or cannot enroll on a user profile
    657657                                 other than the current user profile.
    658658  @retval EFI_UNSUPPORTED        This credential provider does not support enrollment in
     
    661661                                 error.
    662662  @retval EFI_INVALID_PARAMETER  User does not refer to a valid user profile handle.
    663  
     663
    664664**/
    665665EFI_STATUS
     
    682682    return EFI_INVALID_PARAMETER;
    683683  }
    684  
     684
    685685  //
    686686  // Get User Identifier
     
    696696  }
    697697
    698   CopyMem (UsbInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER)); 
     698  CopyMem (UsbInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER));
    699699  FreePool (UserInfo);
    700  
     700
    701701  //
    702702  // Get Token and User ID to UsbInfo.
     
    705705  if (EFI_ERROR (Status)) {
    706706    QuestionStr = GetStringById (STRING_TOKEN (STR_READ_USB_TOKEN_ERROR));
    707     PromptStr   = GetStringById (STRING_TOKEN (STR_INSERT_USB_TOKEN)); 
     707    PromptStr   = GetStringById (STRING_TOKEN (STR_INSERT_USB_TOKEN));
    708708    CreatePopUp (
    709709      EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
     
    717717    FreePool (PromptStr);
    718718    return Status;
    719   } 
     719  }
    720720
    721721  //
    722722  // Check whether User is ever enrolled in the provider.
    723   // 
     723  //
    724724  for (Index = 0; Index < mUsbTable->Count; Index++) {
    725725    UserId = (UINT8 *) &mUsbTable->UserInfo[Index].UserId;
     
    727727      //
    728728      // User already exists, update the password.
    729       //     
     729      //
    730730      break;
    731731    }
    732732  }
    733  
     733
    734734  //
    735735  // Enroll the User to the provider.
     
    749749  This function returns information about the form used when interacting with the
    750750  user during user identification. The form is the first enabled form in the form-set
    751   class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If 
     751  class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
    752752  the user credential provider does not require a form to identify the user, then this
    753753  function should return EFI_NOT_FOUND.
     
    757757  @param[out] FormSetId  On return, holds the identifier of the form set which contains
    758758                         the form used during user identification.
    759   @param[out] FormId     On return, holds the identifier of the form used during user 
     759  @param[out] FormId     On return, holds the identifier of the form used during user
    760760                         identification.
    761                          
     761
    762762  @retval EFI_SUCCESS            Form returned successfully.
    763763  @retval EFI_NOT_FOUND          Form not returned.
    764764  @retval EFI_INVALID_PARAMETER  Hii is NULL or FormSetId is NULL or FormId is NULL.
    765  
     765
    766766**/
    767767EFI_STATUS
     
    774774  )
    775775{
    776   if ((This == NULL) || (Hii == NULL) || 
     776  if ((This == NULL) || (Hii == NULL) ||
    777777      (FormSetId == NULL) || (FormId == NULL)) {
    778778    return EFI_INVALID_PARAMETER;
     
    787787  This optional function returns a bitmap which is less than or equal to the number
    788788  of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND
    789   is returned. 
     789  is returned.
    790790
    791791  @param[in]     This    Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    792   @param[in, out] Width  On entry, points to the desired bitmap width. If NULL then no 
    793                          bitmap information will be returned. On exit, points to the 
     792  @param[in, out] Width  On entry, points to the desired bitmap width. If NULL then no
     793                         bitmap information will be returned. On exit, points to the
    794794                         width of the bitmap returned.
    795795  @param[in, out] Height On entry, points to the desired bitmap height. If NULL then no
    796                          bitmap information will be returned. On exit, points to the 
     796                         bitmap information will be returned. On exit, points to the
    797797                         height of the bitmap returned.
    798   @param[out]    Hii     On return, holds the HII database handle. 
    799   @param[out]    Image   On return, holds the HII image identifier. 
    800  
     798  @param[out]    Hii     On return, holds the HII database handle.
     799  @param[out]    Image   On return, holds the HII image identifier.
     800
    801801  @retval EFI_SUCCESS            Image identifier returned successfully.
    802802  @retval EFI_NOT_FOUND          Image identifier not returned.
    803803  @retval EFI_INVALID_PARAMETER  Hii is NULL or Image is NULL.
    804  
     804
    805805**/
    806806EFI_STATUS
     
    825825
    826826  This function returns a string which describes the credential provider. If no
    827   such string exists, then EFI_NOT_FOUND is returned. 
     827  such string exists, then EFI_NOT_FOUND is returned.
    828828
    829829  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    830830  @param[out] Hii        On return, holds the HII database handle.
    831831  @param[out] String     On return, holds the HII string identifier.
    832  
     832
    833833  @retval EFI_SUCCESS            String identifier returned successfully.
    834834  @retval EFI_NOT_FOUND          String identifier not returned.
    835835  @retval EFI_INVALID_PARAMETER  Hii is NULL or String is NULL.
    836  
     836
    837837**/
    838838EFI_STATUS
     
    861861
    862862  This function returns the user identifier of the user authenticated by this credential
    863   provider. This function is called after the credential-related information has been 
     863  provider. This function is called after the credential-related information has been
    864864  submitted on a form OR after a call to Default() has returned that this credential is
    865865  ready to log on.
    866866
    867867  @param[in]  This           Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    868   @param[in]  User           The user profile handle of the user profile currently being 
     868  @param[in]  User           The user profile handle of the user profile currently being
    869869                             considered by the user identity manager. If NULL, then no user
    870870                             profile is currently under consideration.
    871   @param[out] Identifier     On return, points to the user identifier. 
    872  
     871  @param[out] Identifier     On return, points to the user identifier.
     872
    873873  @retval EFI_SUCCESS            User identifier returned successfully.
    874874  @retval EFI_NOT_READY          No user identifier can be returned.
     
    877877  @retval EFI_NOT_FOUND          User is not NULL, and the specified user handle can't be
    878878                                 found in user profile database.
    879  
     879
    880880**/
    881881EFI_STATUS
     
    892892  UINT8         *UserId;
    893893  UINT8         *NewUserId;
    894   UINT8         *UserToken; 
     894  UINT8         *UserToken;
    895895  UINT8         ReadToken[HASHED_CREDENTIAL_LEN];
    896896  EFI_INPUT_KEY Key;
    897897  CHAR16        *QuestionStr;
    898898  CHAR16        *PromptStr;
    899  
     899
    900900  if ((This == NULL) || (Identifier == NULL)) {
    901901    return EFI_INVALID_PARAMETER;
    902902  }
    903  
     903
    904904  if (User == NULL) {
    905905    //
     
    909909      return EFI_NOT_READY;
    910910    }
    911    
     911
    912912    //
    913913    // No user selected, get token first and verify the user existed in user database.
     
    917917      return EFI_NOT_READY;
    918918    }
    919    
     919
    920920    for (Index = 0; Index < mUsbTable->Count; Index++) {
    921921      //
     
    930930    }
    931931
    932     return EFI_NOT_READY; 
    933   }
    934    
    935   // 
    936   // User is not NULL here. Read a token, and check whether the token matches with 
    937   // the selected user's Token. If not, try to find a token in token DB to matches 
     932    return EFI_NOT_READY;
     933  }
     934
     935  //
     936  // User is not NULL here. Read a token, and check whether the token matches with
     937  // the selected user's Token. If not, try to find a token in token DB to matches
    938938  // with read token.
    939   // 
    940  
     939  //
     940
    941941  Status = GetToken (ReadToken);
    942942  if (EFI_ERROR (Status)) {
     
    962962  if (EFI_ERROR (Status)) {
    963963    return EFI_NOT_FOUND;
    964   } 
    965  
     964  }
     965
    966966  //
    967967  // Check the selected user's Token with the read token.
     
    982982        FreePool (UserInfo);
    983983        return EFI_SUCCESS;
    984       } 
    985     }
    986   }
    987 
    988   FreePool (UserInfo); 
    989    
     984      }
     985    }
     986  }
     987
     988  FreePool (UserInfo);
     989
    990990  return EFI_NOT_READY;
    991991}
     
    995995  Indicate that user interface interaction has begun for the specified credential.
    996996
    997   This function is called when a credential provider is selected by the user. If 
     997  This function is called when a credential provider is selected by the user. If
    998998  AutoLogon returns FALSE, then the user interface will be constructed by the User
    999   Identity Manager. 
     999  Identity Manager.
    10001000
    10011001  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    1002   @param[out] AutoLogon  On return, points to the credential provider's capabilities 
    1003                          after the credential provider has been selected by the user. 
    1004  
     1002  @param[out] AutoLogon  On return, points to the credential provider's capabilities
     1003                         after the credential provider has been selected by the user.
     1004
    10051005  @retval EFI_SUCCESS            Credential provider successfully selected.
    10061006  @retval EFI_INVALID_PARAMETER  AutoLogon is NULL.
    1007  
     1007
    10081008**/
    10091009EFI_STATUS
     
    10301030
    10311031  @param[in] This        Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    1032  
     1032
    10331033  @retval EFI_SUCCESS    Credential provider successfully deselected.
    1034  
     1034
    10351035**/
    10361036EFI_STATUS
     
    10501050  Return the default logon behavior for this user credential.
    10511051
    1052   This function reports the default login behavior regarding this credential provider. 
     1052  This function reports the default login behavior regarding this credential provider.
    10531053
    10541054  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    10551055  @param[out] AutoLogon  On return, holds whether the credential provider should be used
    1056                          by default to automatically log on the user. 
    1057  
     1056                         by default to automatically log on the user.
     1057
    10581058  @retval EFI_SUCCESS            Default information successfully returned.
    10591059  @retval EFI_INVALID_PARAMETER  AutoLogon is NULL.
    1060  
     1060
    10611061**/
    10621062EFI_STATUS
     
    10791079  Return information attached to the credential provider.
    10801080
    1081   This function returns user information. 
     1081  This function returns user information.
    10821082
    10831083  @param[in]      This          Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    1084   @param[in]      UserInfo      Handle of the user information data record. 
     1084  @param[in]      UserInfo      Handle of the user information data record.
    10851085  @param[out]     Info          On entry, points to a buffer of at least *InfoSize bytes. On
    10861086                                exit, holds the user information. If the buffer is too small
     
    10881088                                and InfoSize is updated to contain the number of bytes actually
    10891089                                required.
    1090   @param[in, out] InfoSize      On entry, points to the size of Info. On return, points to the 
    1091                                 size of the user information. 
    1092  
     1090  @param[in, out] InfoSize      On entry, points to the size of Info. On return, points to the
     1091                                size of the user information.
     1092
    10931093  @retval EFI_SUCCESS           Information returned successfully.
    10941094  @retval EFI_BUFFER_TOO_SMALL  The size specified by InfoSize is too small to hold all of the
    10951095                                user information. The size required is returned in *InfoSize.
    10961096  @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
    1097   @retval EFI_NOT_FOUND         The specified UserInfo does not refer to a valid user info handle. 
    1098                                
     1097  @retval EFI_NOT_FOUND         The specified UserInfo does not refer to a valid user info handle.
     1098
    10991099**/
    11001100EFI_STATUS
     
    11091109  EFI_USER_INFO            *CredentialInfo;
    11101110  UINTN                    Index;
    1111  
     1111
    11121112  if ((This == NULL) || (InfoSize == NULL) || (Info == NULL)) {
    11131113    return EFI_INVALID_PARAMETER;
     
    11171117    return EFI_NOT_FOUND;
    11181118  }
    1119  
     1119
    11201120  //
    11211121  // Find information handle in credential info table.
     
    11311131        return EFI_BUFFER_TOO_SMALL;
    11321132      }
    1133      
    1134       CopyMem (Info, CredentialInfo, CredentialInfo->InfoSize);     
    1135       return EFI_SUCCESS;           
    1136     }
    1137   }
    1138  
     1133
     1134      CopyMem (Info, CredentialInfo, CredentialInfo->InfoSize);
     1135      return EFI_SUCCESS;
     1136    }
     1137  }
     1138
    11391139  return EFI_NOT_FOUND;
    11401140}
     
    11471147  information record handle, point UserInfo at a NULL. Each subsequent call will retrieve
    11481148  another user information record handle until there are no more, at which point UserInfo
    1149   will point to NULL. 
     1149  will point to NULL.
    11501150
    11511151  @param[in]      This     Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
     
    11531153                           to start enumeration. On exit, points to the next user information
    11541154                           handle or NULL if there is no more user information.
    1155  
     1155
    11561156  @retval EFI_SUCCESS            User information returned.
    11571157  @retval EFI_NOT_FOUND          No more user information found.
    11581158  @retval EFI_INVALID_PARAMETER  UserInfo is NULL.
    1159  
     1159
    11601160**/
    11611161EFI_STATUS
     
    11711171  UINTN                    Index;
    11721172  UINTN                    ProvStrLen;
    1173    
     1173
    11741174  if ((This == NULL) || (UserInfo == NULL)) {
    11751175    return EFI_INVALID_PARAMETER;
     
    11931193    Info    = AllocateZeroPool (InfoLen);
    11941194    ASSERT (Info != NULL);
    1195    
     1195
    11961196    Info->InfoType    = EFI_USER_INFO_CREDENTIAL_PROVIDER_RECORD;
    11971197    Info->InfoSize    = (UINT32) InfoLen;
     
    11991199    CopyGuid (&Info->Credential, &gUsbCredentialProviderGuid);
    12001200    CopyGuid ((EFI_GUID *)(Info + 1), &gUsbCredentialProviderGuid);
    1201    
     1201
    12021202    mUsbInfoHandle->Info[0] = Info;
    12031203    mUsbInfoHandle->Count++;
     
    12111211    Info        = AllocateZeroPool (InfoLen);
    12121212    ASSERT (Info != NULL);
    1213    
     1213
    12141214    Info->InfoType    = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD;
    12151215    Info->InfoSize    = (UINT32) InfoLen;
     
    12181218    CopyMem ((UINT8*)(Info + 1), ProvNameStr, ProvStrLen);
    12191219    FreePool (ProvNameStr);
    1220    
     1220
    12211221    mUsbInfoHandle->Info[1] = Info;
    12221222    mUsbInfoHandle->Count++;
     
    12281228    Info    = AllocateZeroPool (InfoLen);
    12291229    ASSERT (Info != NULL);
    1230      
     1230
    12311231    Info->InfoType    = EFI_USER_INFO_CREDENTIAL_TYPE_RECORD;
    12321232    Info->InfoSize    = (UINT32) InfoLen;
     
    12341234    CopyGuid (&Info->Credential, &gUsbCredentialProviderGuid);
    12351235    CopyGuid ((EFI_GUID *)(Info + 1), &gEfiUserCredentialClassSecureCardGuid);
    1236    
     1236
    12371237    mUsbInfoHandle->Info[2] = Info;
    12381238    mUsbInfoHandle->Count++;
    1239  
     1239
    12401240    //
    12411241    // The fourth information, Credential Provider type name info.
     
    12461246    Info        = AllocateZeroPool (InfoLen);
    12471247    ASSERT (Info != NULL);
    1248    
     1248
    12491249    Info->InfoType    = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD;
    12501250    Info->InfoSize    = (UINT32) InfoLen;
     
    12531253    CopyMem ((UINT8*)(Info + 1), ProvNameStr, ProvStrLen);
    12541254    FreePool (ProvNameStr);
    1255    
     1255
    12561256    mUsbInfoHandle->Info[3] = Info;
    12571257    mUsbInfoHandle->Count++;
    12581258  }
    1259  
     1259
    12601260  if (*UserInfo == NULL) {
    12611261    //
     
    12651265    return EFI_SUCCESS;
    12661266  }
    1267  
     1267
    12681268  //
    12691269  // Find information handle in credential info table.
     
    12841284      Index++;
    12851285      *UserInfo = (EFI_USER_INFO_HANDLE)mUsbInfoHandle->Info[Index];
    1286       return EFI_SUCCESS; 
     1286      return EFI_SUCCESS;
    12871287    }
    12881288  }
     
    12961296  Delete a user on this credential provider.
    12971297
    1298   This function deletes a user on this credential provider. 
     1298  This function deletes a user on this credential provider.
    12991299
    13001300  @param[in]     This            Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
     
    13021302
    13031303  @retval EFI_SUCCESS            User profile was successfully deleted.
    1304   @retval EFI_ACCESS_DENIED      Current user profile does not permit deletion on the user profile handle. 
    1305                                  Either the user profile cannot delete on any user profile or cannot delete 
    1306                                  on a user profile other than the current user profile. 
     1304  @retval EFI_ACCESS_DENIED      Current user profile does not permit deletion on the user profile handle.
     1305                                 Either the user profile cannot delete on any user profile or cannot delete
     1306                                 on a user profile other than the current user profile.
    13071307  @retval EFI_UNSUPPORTED        This credential provider does not support deletion in the pre-OS.
    13081308  @retval EFI_DEVICE_ERROR       The new credential could not be deleted because of a device error.
     
    13211321  UINT8                     *NewUserId;
    13221322  UINTN                     Index;
    1323  
     1323
    13241324  if ((This == NULL) || (User == NULL)) {
    13251325    return EFI_INVALID_PARAMETER;
     
    13411341  //
    13421342  // Find the user by user identifier in mPwdTable.
    1343   // 
     1343  //
    13441344  for (Index = 0; Index < mUsbTable->Count; Index++) {
    13451345    UserId    = (UINT8 *) &mUsbTable->UserInfo[Index].UserId;
     
    13891389    return Status;
    13901390  }
    1391  
     1391
    13921392  //
    13931393  // Init Form Browser
     
    13971397    return Status;
    13981398  }
    1399  
     1399
    14001400  //
    14011401  // Install protocol interfaces for the Usb Credential Provider.
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProvider.h

    r48674 r58466  
    11/** @file
    22  Usb Credential Provider driver header file.
    3    
     3
    44Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    8181  Enroll a user on a credential provider.
    8282
    83   This function enrolls and deletes a user profile using this credential provider. 
    84   If a user profile is successfully enrolled, it calls the User Manager Protocol 
    85   function Notify() to notify the user manager driver that credential information 
    86   has changed. If an enrolled user does exist, delete the user on the credential 
     83  This function enrolls and deletes a user profile using this credential provider.
     84  If a user profile is successfully enrolled, it calls the User Manager Protocol
     85  function Notify() to notify the user manager driver that credential information
     86  has changed. If an enrolled user does exist, delete the user on the credential
    8787  provider.
    8888
    8989  @param[in] This                Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL.
    9090  @param[in] User                The user profile to enroll.
    91  
     91
    9292  @retval EFI_SUCCESS            User profile was successfully enrolled.
    9393  @retval EFI_ACCESS_DENIED      Current user profile does not permit enrollment on the
    9494                                 user profile handle. Either the user profile cannot enroll
    95                                  on any user profile or cannot enroll on a user profile 
     95                                 on any user profile or cannot enroll on a user profile
    9696                                 other than the current user profile.
    9797  @retval EFI_UNSUPPORTED        This credential provider does not support enrollment in
     
    100100                                 error.
    101101  @retval EFI_INVALID_PARAMETER  User does not refer to a valid user profile handle.
    102  
     102
    103103**/
    104104EFI_STATUS
     
    112112  Returns the user interface information used during user identification.
    113113
    114   This function enrolls a user on this credential provider. If the user exists on 
    115   this credential provider, update the user information on this credential provider; 
     114  This function enrolls a user on this credential provider. If the user exists on
     115  this credential provider, update the user information on this credential provider;
    116116  otherwise delete the user information on credential provider.
    117117
     
    120120  @param[out] FormSetId  On return, holds the identifier of the form set which contains
    121121                         the form used during user identification.
    122   @param[out] FormId     On return, holds the identifier of the form used during user 
     122  @param[out] FormId     On return, holds the identifier of the form used during user
    123123                         identification.
    124                          
     124
    125125  @retval EFI_SUCCESS            Form returned successfully.
    126126  @retval EFI_NOT_FOUND          Form not returned.
    127127  @retval EFI_INVALID_PARAMETER  Hii is NULL or FormSetId is NULL or FormId is NULL.
    128  
     128
    129129**/
    130130EFI_STATUS
     
    142142  This optional function returns a bitmap which is less than or equal to the number
    143143  of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND
    144   is returned. 
     144  is returned.
    145145
    146146  @param[in]     This    Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    147   @param[in, out] Width  On entry, points to the desired bitmap width. If NULL then no 
    148                          bitmap information will be returned. On exit, points to the 
     147  @param[in, out] Width  On entry, points to the desired bitmap width. If NULL then no
     148                         bitmap information will be returned. On exit, points to the
    149149                         width of the bitmap returned.
    150150  @param[in, out] Height On entry, points to the desired bitmap height. If NULL then no
    151                          bitmap information will be returned. On exit, points to the 
     151                         bitmap information will be returned. On exit, points to the
    152152                         height of the bitmap returned.
    153   @param[out]    Hii     On return, holds the HII database handle. 
    154   @param[out]    Image   On return, holds the HII image identifier. 
    155  
     153  @param[out]    Hii     On return, holds the HII database handle.
     154  @param[out]    Image   On return, holds the HII image identifier.
     155
    156156  @retval EFI_SUCCESS            Image identifier returned successfully.
    157157  @retval EFI_NOT_FOUND          Image identifier not returned.
    158158  @retval EFI_INVALID_PARAMETER  Hii is NULL or Image is NULL.
    159  
     159
    160160**/
    161161EFI_STATUS
     
    173173
    174174  This function returns a string which describes the credential provider. If no
    175   such string exists, then EFI_NOT_FOUND is returned. 
     175  such string exists, then EFI_NOT_FOUND is returned.
    176176
    177177  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    178178  @param[out] Hii        On return, holds the HII database handle.
    179179  @param[out] String     On return, holds the HII string identifier.
    180  
     180
    181181  @retval EFI_SUCCESS            String identifier returned successfully.
    182182  @retval EFI_NOT_FOUND          String identifier not returned.
    183183  @retval EFI_INVALID_PARAMETER  Hii is NULL or String is NULL.
    184  
     184
    185185**/
    186186EFI_STATUS
     
    196196
    197197  This function returns the user identifier of the user authenticated by this credential
    198   provider. This function is called after the credential-related information has been 
     198  provider. This function is called after the credential-related information has been
    199199  submitted on a form OR after a call to Default() has returned that this credential is
    200200  ready to log on.
    201201
    202202  @param[in]  This           Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    203   @param[in]  User           The user profile handle of the user profile currently being 
     203  @param[in]  User           The user profile handle of the user profile currently being
    204204                             considered by the user identity manager. If NULL, then no user
    205205                             profile is currently under consideration.
    206   @param[out] Identifier     On return, points to the user identifier. 
    207  
     206  @param[out] Identifier     On return, points to the user identifier.
     207
    208208  @retval EFI_SUCCESS        User identifier returned successfully.
    209209  @retval EFI_NOT_READY      No user identifier can be returned.
     
    212212  @retval EFI_NOT_FOUND          User is not NULL, and the specified user handle can't be
    213213                                 found in user profile database.
    214  
     214
    215215**/
    216216EFI_STATUS
     
    225225  Indicate that user interface interaction has begun for the specified credential.
    226226
    227   This function is called when a credential provider is selected by the user. If 
     227  This function is called when a credential provider is selected by the user. If
    228228  AutoLogon returns FALSE, then the user interface will be constructed by the User
    229   Identity Manager. 
     229  Identity Manager.
    230230
    231231  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    232   @param[out] AutoLogon  On return, points to the credential provider's capabilities 
    233                          after the credential provider has been selected by the user. 
    234  
     232  @param[out] AutoLogon  On return, points to the credential provider's capabilities
     233                         after the credential provider has been selected by the user.
     234
    235235  @retval EFI_SUCCESS            Credential provider successfully selected.
    236236  @retval EFI_INVALID_PARAMETER  AutoLogon is NULL.
    237  
     237
    238238**/
    239239EFI_STATUS
     
    250250
    251251  @param[in] This        Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    252  
     252
    253253  @retval EFI_SUCCESS    Credential provider successfully deselected.
    254  
     254
    255255**/
    256256EFI_STATUS
     
    263263  Return the default logon behavior for this user credential.
    264264
    265   This function reports the default login behavior regarding this credential provider. 
     265  This function reports the default login behavior regarding this credential provider.
    266266
    267267  @param[in]  This       Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    268268  @param[out] AutoLogon  On return, holds whether the credential provider should be used
    269                          by default to automatically log on the user. 
    270  
     269                         by default to automatically log on the user.
     270
    271271  @retval EFI_SUCCESS            Default information successfully returned.
    272272  @retval EFI_INVALID_PARAMETER  AutoLogon is NULL.
     
    283283  Return information attached to the credential provider.
    284284
    285   This function returns user information. 
     285  This function returns user information.
    286286
    287287  @param[in]      This          Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
    288   @param[in]      UserInfo      Handle of the user information data record. 
     288  @param[in]      UserInfo      Handle of the user information data record.
    289289  @param[out]     Info          On entry, points to a buffer of at least *InfoSize bytes. On
    290290                                exit, holds the user information. If the buffer is too small
     
    292292                                and InfoSize is updated to contain the number of bytes actually
    293293                                required.
    294   @param[in, out] InfoSize      On entry, points to the size of Info. On return, points to the 
    295                                 size of the user information. 
    296  
     294  @param[in, out] InfoSize      On entry, points to the size of Info. On return, points to the
     295                                size of the user information.
     296
    297297  @retval EFI_SUCCESS           Information returned successfully.
    298298  @retval EFI_BUFFER_TOO_SMALL  The size specified by InfoSize is too small to hold all of the
    299299                                user information. The size required is returned in *InfoSize.
    300300  @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
    301   @retval EFI_NOT_FOUND         The specified UserInfo does not refer to a valid user info handle. 
    302                                
     301  @retval EFI_NOT_FOUND         The specified UserInfo does not refer to a valid user info handle.
     302
    303303**/
    304304EFI_STATUS
     
    317317  information record handle, point UserInfo at a NULL. Each subsequent call will retrieve
    318318  another user information record handle until there are no more, at which point UserInfo
    319   will point to NULL. 
     319  will point to NULL.
    320320
    321321  @param[in]      This     Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
     
    323323                           to start enumeration. On exit, points to the next user information
    324324                           handle or NULL if there is no more user information.
    325  
     325
    326326  @retval EFI_SUCCESS            User information returned.
    327327  @retval EFI_NOT_FOUND          No more user information found.
    328328  @retval EFI_INVALID_PARAMETER  UserInfo is NULL.
    329  
     329
    330330**/
    331331EFI_STATUS
     
    339339  Delete a user on this credential provider.
    340340
    341   This function deletes a user on this credential provider. 
     341  This function deletes a user on this credential provider.
    342342
    343343  @param[in]     This            Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
     
    345345
    346346  @retval EFI_SUCCESS            User profile was successfully deleted.
    347   @retval EFI_ACCESS_DENIED      Current user profile does not permit deletion on the user profile handle. 
    348                                  Either the user profile cannot delete on any user profile or cannot delete 
    349                                  on a user profile other than the current user profile. 
     347  @retval EFI_ACCESS_DENIED      Current user profile does not permit deletion on the user profile handle.
     348                                 Either the user profile cannot delete on any user profile or cannot delete
     349                                 on a user profile other than the current user profile.
    350350  @retval EFI_UNSUPPORTED        This credential provider does not support deletion in the pre-OS.
    351351  @retval EFI_DEVICE_ERROR       The new credential could not be deleted because of a device error.
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProviderDxe.inf

    r58459 r58466  
    22#  Provides a USB credential provider implementation
    33#
    4 #  This module reads a token from a token file that is saved in the root 
     4#  This module reads a token from a token file that is saved in the root
    55#  folder of a USB stick. The token file name can be specified by the PCD
    66#  PcdFixedUsbCredentialProviderTokenFileName.
     
    4646  UefiLib
    4747  BaseCryptLib
    48  
     48
    4949[Guids]
    5050  ## PRODUCES             ## Variable:L"UsbCredential"
     
    5353  ## SOMETIMES_CONSUMES   ## GUID               # The credential provider identifier
    5454  gUsbCredentialProviderGuid
    55  
     55
    5656  gEfiFileInfoGuid                              ## SOMETIMES_CONSUMES         ## GUID
    5757  gEfiUserCredentialClassSecureCardGuid         ## SOMETIMES_CONSUMES         ## GUID
    5858
    5959[Pcd]
    60   gEfiSecurityPkgTokenSpaceGuid.PcdFixedUsbCredentialProviderTokenFileName    ## SOMETIMES_CONSUMES 
     60  gEfiSecurityPkgTokenSpaceGuid.PcdFixedUsbCredentialProviderTokenFileName    ## SOMETIMES_CONSUMES
    6161
    6262[Protocols]
     
    6565  gEfiBlockIoProtocolGuid                       ## SOMETIMES_CONSUMES
    6666  gEfiSimpleFileSystemProtocolGuid              ## SOMETIMES_CONSUMES
    67  
     67
    6868[UserExtensions.TianoCore."ExtraFiles"]
    6969  UsbCredentialProviderExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProviderStrings.uni

    • Property svn:mime-type changed from application/octet-stream to text/plain;encoding=UTF-16LE
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/LoadDeferredImage.c

    r48674 r58466  
    11/** @file
    22  Load the deferred images after user is identified.
    3    
     3
    44Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    4040  EFI_DEVICE_PATH_PROTOCOL           *ImageDevicePath;
    4141  VOID                               *DriverImage;
    42   UINTN                              ImageSize; 
     42  UINTN                              ImageSize;
    4343  BOOLEAN                            BootOption;
    4444  EFI_HANDLE                         ImageHandle;
     
    7878      //
    7979      Status = DeferredImage->GetImageInfo(
    80                                 DeferredImage, 
    81                                 DriverIndex, 
    82                                 &ImageDevicePath, 
     80                                DeferredImage,
     81                                DriverIndex,
     82                                &ImageDevicePath,
    8383                                (VOID **) &DriverImage,
    84                                 &ImageSize, 
     84                                &ImageSize,
    8585                                &BootOption
    8686                                );
    8787      if (EFI_ERROR (Status)) {
    8888        break;
    89       } 
     89      }
    9090
    9191      //
     
    107107        gBS->SetWatchdogTimer (5 * 60, 0x0000, 0x00, NULL);
    108108        Status = gBS->StartImage (ImageHandle, &ExitDataSize, &ExitData);
    109    
     109
    110110        //
    111111        // Clear the Watchdog Timer after the image returns.
     
    116116    } while (TRUE);
    117117  }
    118   FreePool (HandleBuf); 
     118  FreePool (HandleBuf);
    119119}
    120120
     
    135135
    136136  mDeferredImageHandle = ImageHandle;
    137  
     137
    138138  Status = gBS->CreateEventEx (
    139139                  EVT_NOTIFY_SIGNAL,
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c

    r58459 r58466  
    11/** @file
    22  This driver manages user information and produces user manager protocol.
    3  
     3
    44Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    8181  Find the specified user in the user database.
    8282
    83   This function searches the specified user from the beginning of the user database. 
    84   And if NextUser is TRUE, return the next User in the user database. 
    85  
    86   @param[in, out] User         On entry, points to the user profile entry to search. 
     83  This function searches the specified user from the beginning of the user database.
     84  And if NextUser is TRUE, return the next User in the user database.
     85
     86  @param[in, out] User         On entry, points to the user profile entry to search.
    8787                               On return, points to the user profile entry or NULL if not found.
    8888  @param[in]      NextUser     If FALSE, find the user in user profile database specifyed by User
    89                                If TRUE, find the next user in user profile database specifyed 
    90                                by User. 
    91   @param[out]     ProfileIndex A pointer to the index of user profile database that matches the 
     89                               If TRUE, find the next user in user profile database specifyed
     90                               by User.
     91  @param[out]     ProfileIndex A pointer to the index of user profile database that matches the
    9292                               user specifyed by User.
    9393
    9494  @retval EFI_NOT_FOUND        User was NULL, or User was not found, or the next user was not found.
    9595  @retval EFI_SUCCESS          User or the next user are found in user profile database
    96  
     96
    9797**/
    9898EFI_STATUS
     
    111111    return EFI_NOT_FOUND;
    112112  }
    113  
     113
    114114  //
    115115  // Check whether the user profile is in the user profile database.
     
    152152  Find the specified user information record in the specified User profile.
    153153
    154   This function searches the specified user information record from the beginning of the user 
    155   profile. And if NextInfo is TRUE, return the next info in the user profile. 
    156  
    157   @param[in]      User     Points to the user profile entry.                             
     154  This function searches the specified user information record from the beginning of the user
     155  profile. And if NextInfo is TRUE, return the next info in the user profile.
     156
     157  @param[in]      User     Points to the user profile entry.
    158158  @param[in, out] Info     On entry, points to the user information record or NULL to start
    159159                           searching with the first user information record.
    160                            On return, points to the user information record or NULL if not found.                           
     160                           On return, points to the user information record or NULL if not found.
    161161  @param[in]      NextInfo If FALSE, find the user information record in profile specifyed by User.
    162                            If TRUE, find the next user information record in profile specifyed 
    163                            by User. 
     162                           If TRUE, find the next user information record in profile specifyed
     163                           by User.
    164164  @param[out]     Offset   A pointer to the offset of the information record in the user profile.
    165165
     
    167167  @retval EFI_NOT_FOUND         Info was not found, or the next Info was not found.
    168168  @retval EFI_SUCCESS           Info or the next info are found in user profile.
    169  
     169
    170170**/
    171171EFI_STATUS
     
    184184    return EFI_INVALID_PARAMETER;
    185185  }
    186  
     186
    187187  //
    188188  // Check user profile entry
     
    207207    InfoLen += ALIGN_VARIABLE (UserInfo->InfoSize);
    208208  }
    209  
     209
    210210  //
    211211  // Check whether to find the next user information.
     
    245245  Find a user infomation record by the information record type.
    246246
    247   This function searches all user information records of User. The search starts with the 
    248   user information record following Info and continues until either the information is found 
     247  This function searches all user information records of User. The search starts with the
     248  user information record following Info and continues until either the information is found
    249249  or there are no more user infomation record.
    250250  A match occurs when a Info.InfoType field matches the user information record type.
    251251
    252   @param[in]      User     Points to the user profile record to search.                         
     252  @param[in]      User     Points to the user profile record to search.
    253253  @param[in, out] Info     On entry, points to the user information record or NULL to start
    254254                           searching with the first user information record.
     
    257257
    258258  @retval EFI_SUCCESS           User information was found. Info points to the user information record.
    259   @retval EFI_NOT_FOUND         User information was not found.                           
     259  @retval EFI_NOT_FOUND         User information was not found.
    260260  @retval EFI_INVALID_PARAMETER User is NULL or Info is NULL.
    261  
     261
    262262**/
    263263EFI_STATUS
     
    275275    return EFI_INVALID_PARAMETER;
    276276  }
    277  
     277
    278278  //
    279279  // Check whether the user has the specified user information.
     
    289289    return EFI_NOT_FOUND;
    290290  }
    291  
     291
    292292  while (InfoLen < User->UserProfileSize) {
    293293    UserInfo = (EFI_USER_INFO *) (User->ProfileInfo + InfoLen);
     
    309309  Find a user using a user information record.
    310310
    311   This function searches all user profiles for the specified user information record. The 
    312   search starts with the user information record handle following UserInfo and continues 
     311  This function searches all user profiles for the specified user information record. The
     312  search starts with the user information record handle following UserInfo and continues
    313313  until either the information is found or there are no more user profiles.
    314   A match occurs when the Info.InfoType field matches the user information record type and the 
     314  A match occurs when the Info.InfoType field matches the user information record type and the
    315315  user information record data matches the portion of Info passed the EFI_USER_INFO header.
    316316
    317   @param[in, out] User     On entry, points to the previously returned user profile record, 
    318                            or NULL to start searching with the first user profile. 
     317  @param[in, out] User     On entry, points to the previously returned user profile record,
     318                           or NULL to start searching with the first user profile.
    319319                           On return, points to the user profile entry, or NULL if not found.
    320   @param[in, out] UserInfo On entry, points to the previously returned user information record, 
    321                            or NULL to start searching with the first. 
     320  @param[in, out] UserInfo On entry, points to the previously returned user information record,
     321                           or NULL to start searching with the first.
    322322                           On return, points to the user information record, or NULL if not found.
    323   @param[in]      Info     Points to the buffer containing the user information to be compared 
     323  @param[in]      Info     Points to the buffer containing the user information to be compared
    324324                           to the user information record.
    325325  @param[in]      InfoSize The size of Info, in bytes. Same as Info->InfoSize.
    326326
    327   @retval EFI_SUCCESS           User information was found. User points to the user profile record, 
     327  @retval EFI_SUCCESS           User information was found. User points to the user profile record,
    328328                                and UserInfo points to the user information record.
    329   @retval EFI_NOT_FOUND         User information was not found.                           
     329  @retval EFI_NOT_FOUND         User information was not found.
    330330  @retval EFI_INVALID_PARAMETER User is NULL; Info is NULL; or, InfoSize is too small.
    331  
     331
    332332**/
    333333EFI_STATUS
     
    362362    *User = mUserProfileDb->UserProfile[0];
    363363  }
    364  
     364
    365365  //
    366366  // Check user profile handle.
     
    377377        break;
    378378      }
    379      
     379
    380380      if (InfoSize == Info->InfoSize) {
    381381        if (CompareMem ((UINT8 *) (InfoEntry + 1), (UINT8 *) (Info + 1), InfoSize - sizeof (EFI_USER_INFO)) == 0) {
     
    388388          return EFI_SUCCESS;
    389389        }
    390       }     
    391     }
    392    
     390      }
     391    }
     392
    393393    //
    394394    // Get next user profile.
     
    410410  @retval TRUE     The policy is a valid access policy.
    411411  @retval FALSE    The access policy is not a valid access policy.
    412  
     412
    413413**/
    414414BOOLEAN
     
    430430    // Check access policy according to type.
    431431    //
    432     CopyMem (&Access, PolicyInfo + TotalLen, sizeof (Access));   
     432    CopyMem (&Access, PolicyInfo + TotalLen, sizeof (Access));
    433433    ValueLen = Access.Size - sizeof (EFI_USER_INFO_ACCESS_CONTROL);
    434434    switch (Access.Type) {
     
    492492  @retval TRUE     The policy is a valid identity policy.
    493493  @retval FALSE    The access policy is not a valid identity policy.
    494  
     494
    495495**/
    496496BOOLEAN
     
    602602  @retval TRUE     The info is a valid user information record.
    603603  @retval FALSE    The info is not a valid user information record.
    604  
     604
    605605**/
    606606BOOLEAN
     
    697697  @retval TRUE     It is a valid user profile.
    698698  @retval FALSE    It is not a valid user profile.
    699  
     699
    700700**/
    701701BOOLEAN
     
    711711    return FALSE;
    712712  }
    713  
     713
    714714  //
    715715  // Check user profile information length.
     
    742742                             EFI_USER_INFO_ACCESS_ENROLL_OTHERS or
    743743                             EFI_USER_INFO_ACCESS_ENROLL_SELF.
    744  
     744
    745745  @retval TRUE     Find the specified RightType in current user profile.
    746746  @retval FALSE    Can't find the right in the profile.
    747  
     747
    748748**/
    749749BOOLEAN
     
    882882  @retval TRUE     Success to expand user profile database.
    883883  @retval FALSE    Fail to expand user profile database.
    884  
     884
    885885**/
    886886BOOLEAN
     
    935935
    936936  @param[in]  User                    Points to user profile.
    937   @param[in]  ExpandSize              The size of user profile. 
     937  @param[in]  ExpandSize              The size of user profile.
    938938
    939939  @retval TRUE     Success to expand user profile size.
    940940  @retval FALSE    Fail to expand user profile size.
    941  
     941
    942942**/
    943943BOOLEAN
     
    959959    return FALSE;
    960960  }
    961  
     961
    962962  //
    963963  // Copy exist information.
     
    981981  @retval EFI_SUCCESS      Save or delete user profile successfully.
    982982  @retval Others           Fail to change the profile.
    983  
     983
    984984**/
    985985EFI_STATUS
     
    998998    return Status;
    999999  }
    1000  
     1000
    10011001  //
    10021002  // Save the user profile to non-volatile memory.
     
    10401040    return EFI_INVALID_PARAMETER;
    10411041  }
    1042  
     1042
    10431043  //
    10441044  // Check user profile handle.
     
    10481048    return Status;
    10491049  }
    1050  
     1050
    10511051  //
    10521052  // Check user information memory size.
     
    10571057    }
    10581058  }
    1059  
     1059
    10601060  //
    10611061  // Add new user information.
     
    10831083  @param[in]      User            Point to the user profile.
    10841084  @param[in]      UserInfo        Point to the user information record to get.
    1085   @param[out]     Info            On entry, points to a buffer of at least *InfoSize bytes. 
     1085  @param[out]     Info            On entry, points to a buffer of at least *InfoSize bytes.
    10861086                                  On exit, holds the user information.
    1087   @param[in, out] InfoSize        On entry, points to the size of Info. 
     1087  @param[in, out] InfoSize        On entry, points to the size of Info.
    10881088                                  On return, points to the size of the user information.
    10891089  @param[in]      ChkRight        If TRUE, check the user info attribute.
     
    10931093  @retval EFI_ACCESS_DENIED       The information cannot be accessed by the current user.
    10941094  @retval EFI_INVALID_PARAMETER   InfoSize is NULL or UserInfo is NULL.
    1095   @retval EFI_BUFFER_TOO_SMALL    The number of bytes specified by *InfoSize is too small to hold the 
     1095  @retval EFI_BUFFER_TOO_SMALL    The number of bytes specified by *InfoSize is too small to hold the
    10961096                                  returned data. The actual size required is returned in *InfoSize.
    10971097  @retval EFI_SUCCESS             Information returned successfully.
     
    11161116    return EFI_INVALID_PARAMETER;
    11171117  }
    1118  
     1118
    11191119  //
    11201120  // Find the user information to get.
     
    11241124    return Status;
    11251125  }
    1126  
     1126
    11271127  //
    11281128  // Check information attributes.
     
    11451145    }
    11461146  }
    1147  
     1147
    11481148  //
    11491149  // Get user information.
     
    11971197    return EFI_ACCESS_DENIED;
    11981198  }
    1199  
     1199
    12001200  //
    12011201  // Delete the specified user information.
     
    12201220  @param[in]      User           Point to the user profile.
    12211221  @param[in, out] UserInfo       On entry, points to the user information to modify,
    1222                                  or NULL to add a new UserInfo. 
     1222                                 or NULL to add a new UserInfo.
    12231223                                 On return, points to the modified user information.
    12241224  @param[in]      Info           Points to the new user information.
     
    12491249    return EFI_INVALID_PARAMETER;
    12501250  }
    1251  
     1251
    12521252  //
    12531253  // Check user information.
     
    12561256    return EFI_ACCESS_DENIED;
    12571257  }
    1258  
     1258
    12591259  if (!CheckUserInfo (Info)) {
    12601260    return EFI_INVALID_PARAMETER;
     
    12741274      ASSERT (OldInfo != NULL);
    12751275
    1276       if (((OldInfo->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) || 
     1276      if (((OldInfo->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) ||
    12771277           ((Info->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0)) {
    12781278        //
     
    12921292        continue;
    12931293      }
    1294  
     1294
    12951295      PayloadLen = Info->InfoSize - sizeof (EFI_USER_INFO);
    12961296      if (PayloadLen == 0) {
     
    13111311    return Status;
    13121312  }
    1313  
     1313
    13141314  //
    13151315  // Modify existing user information.
     
    13191319    return EFI_INVALID_PARAMETER;
    13201320  }
    1321  
    1322   if (((Info->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) && 
     1321
     1322  if (((Info->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) &&
    13231323       (OldInfo->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) == 0) {
    13241324    //
    1325     // Try to add exclusive attrib in new info. 
     1325    // Try to add exclusive attrib in new info.
    13261326    // Check whether there is another information with the same type in profile.
    13271327    //
     
    13391339        return EFI_ACCESS_DENIED;
    13401340      }
    1341     } while (TRUE);   
     1341    } while (TRUE);
    13421342  }
    13431343
     
    13581358  @retval EFI_SUCCESS      Delete user from the user profile successfully.
    13591359  @retval Others           Fail to delete user from user profile
    1360  
     1360
    13611361**/
    13621362EFI_STATUS
     
    13751375    return EFI_INVALID_PARAMETER;
    13761376  }
    1377  
     1377
    13781378  //
    13791379  // Check whether it is the current user.
     
    13821382    return EFI_ACCESS_DENIED;
    13831383  }
    1384  
     1384
    13851385  //
    13861386  // Delete user profile from the non-volatile memory.
     
    14491449    return EFI_SECURITY_VIOLATION;
    14501450  }
    1451  
     1451
    14521452  //
    14531453  // Create user profile entry.
     
    14681468
    14691469  UnicodeSPrint (
    1470     User->UserVarName, 
     1470    User->UserVarName,
    14711471    sizeof (User->UserVarName),
    1472     L"User%04x", 
     1472    L"User%04x",
    14731473    mUserProfileDb->UserProfileNum
    14741474    );
     
    15321532  UserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV | EFI_USER_INFO_PUBLIC | EFI_USER_INFO_EXCLUSIVE;
    15331533  GenerateUserId ((UINT8 *) (UserInfo + 1));
    1534  
     1534
    15351535  //
    15361536  // Add user profile to the user profile database.
     
    15471547  @retval EFI_SUCCESS             A default user profile is added successfully.
    15481548  @retval Others                  Fail to add a default user profile
    1549  
     1549
    15501550**/
    15511551EFI_STATUS
     
    15621562  EFI_USER_INFO_ACCESS_CONTROL  *Access;
    15631563  EFI_USER_INFO_IDENTITY_POLICY *Policy;
    1564  
     1564
    15651565  //
    15661566  // Create a user profile.
     
    15701570    return Status;
    15711571  }
    1572  
     1572
    15731573  //
    15741574  // Allocate a buffer to add all default user information.
     
    15911591    goto Done;
    15921592  }
    1593  
     1593
    15941594  //
    15951595  // Add user profile create date record.
     
    16091609    goto Done;
    16101610  }
    1611  
     1611
    16121612  //
    16131613  // Add user profile usage count record.
     
    16231623    goto Done;
    16241624  }
    1625  
     1625
    16261626  //
    16271627  // Add user access right.
     
    16381638    goto Done;
    16391639  }
    1640  
     1640
    16411641  //
    16421642  // Add user identity policy.
     
    16461646  Policy            = (EFI_USER_INFO_IDENTITY_POLICY *) (Info + 1);
    16471647  Policy->Type      = EFI_USER_INFO_IDENTITY_TRUE;
    1648   Policy->Length    = sizeof (EFI_USER_INFO_IDENTITY_POLICY); 
     1648  Policy->Length    = sizeof (EFI_USER_INFO_IDENTITY_POLICY);
    16491649  Info->InfoSize    = sizeof (EFI_USER_INFO) + Policy->Length;
    16501650  NewInfo = NULL;
     
    16601660  Publish current user information into EFI System Configuration Table.
    16611661
    1662   By UEFI spec, the User Identity Manager will publish the current user profile 
     1662  By UEFI spec, the User Identity Manager will publish the current user profile
    16631663  into the EFI System Configuration Table. Currently, only the user identifier and user
    16641664  name are published.
     
    16851685  if (!EFI_ERROR (Status)) {
    16861686    //
    1687     // The table existed! 
     1687    // The table existed!
    16881688    //
    16891689    return EFI_SUCCESS;
     
    17071707    return Status;
    17081708  }
    1709  
     1709
    17101710  //
    17111711  // Allocate a buffer for user information table.
    17121712  //
    17131713  UserInfoTable = (EFI_USER_INFO_TABLE *) AllocateRuntimePool (
    1714                                             sizeof (EFI_USER_INFO_TABLE) + 
    1715                                             IdInfo->InfoSize + 
     1714                                            sizeof (EFI_USER_INFO_TABLE) +
     1715                                            IdInfo->InfoSize +
    17161716                                            NameInfo->InfoSize
    17171717                                            );
     
    17211721  }
    17221722
    1723   UserInfoTable->Size = sizeof (EFI_USER_INFO_TABLE); 
    1724  
     1723  UserInfoTable->Size = sizeof (EFI_USER_INFO_TABLE);
     1724
    17251725  //
    17261726  // Append the user information to the user info table
     
    17401740  Get the user's identity type.
    17411741
    1742   The identify manager only supports the identity policy in which the credential 
     1742  The identify manager only supports the identity policy in which the credential
    17431743  provider handles are connected by the operator 'AND' or 'OR'.
    17441744
     
    17711771  }
    17721772  ASSERT (IdentifyInfo != NULL);
    1773  
     1773
    17741774  //
    17751775  // Search the user identify policy according to type.
     
    18231823    return EFI_INVALID_PARAMETER;
    18241824  }
    1825  
     1825
    18261826  //
    18271827  // Check the user ID identified by the specified credential provider.
     
    18431843        //
    18441844        Status = UserCredential->Form (
    1845                                    UserCredential, 
    1846                                    &HiiHandle, 
    1847                                    &FormSetId, 
     1845                                   UserCredential,
     1846                                   &HiiHandle,
     1847                                   &FormSetId,
    18481848                                   &FormId
    18491849                                   );
    1850         if (!EFI_ERROR (Status)) {       
     1850        if (!EFI_ERROR (Status)) {
    18511851          //
    18521852          // Send form to get user input.
     
    18631863          if (EFI_ERROR (Status)) {
    18641864            return Status;
    1865           }                                           
    1866         }       
     1865          }
     1866        }
    18671867      }
    18681868
     
    18761876        return Status;
    18771877      }
    1878      
     1878
    18791879      return EFI_SUCCESS;
    18801880    }
     
    19141914    return EFI_OUT_OF_RESOURCES;
    19151915  }
    1916  
     1916
    19171917  //
    19181918  // Check create date record.
     
    19381938    }
    19391939  }
    1940  
     1940
    19411941  //
    19421942  // Update usage date record.
     
    19611961    }
    19621962  }
    1963  
     1963
    19641964  //
    19651965  // Update usage count record.
     
    20432043
    20442044  @param[in]  Index            The index of the user in the user name list.
    2045   @param[in]  User             Points to the user profile whose username is added. 
     2045  @param[in]  User             Points to the user profile whose username is added.
    20462046  @param[in]  OpCodeHandle     Points to container for dynamic created opcodes.
    20472047
     
    20662066    return Status;
    20672067  }
    2068  
     2068
    20692069  //
    20702070  // Add user name selection.
     
    20902090/**
    20912091  Identify the user whose identity policy does not contain the operator 'OR'.
    2092  
     2092
    20932093  @param[in]  User             Points to the user profile.
    20942094
    20952095  @retval EFI_SUCCESS          The specified user is identified successfully.
    20962096  @retval Others               Fail to identify the user.
    2097  
     2097
    20982098**/
    20992099EFI_STATUS
     
    21182118  }
    21192119  ASSERT (IdentifyInfo != NULL);
    2120  
     2120
    21212121  //
    21222122  // Check each part of identification policy expression.
     
    22132213/**
    22142214  Identify the user whose identity policy does not contain the operator 'AND'.
    2215  
     2215
    22162216  @param[in]  User             Points to the user profile.
    22172217
    22182218  @retval EFI_SUCCESS          The specified user is identified successfully.
    22192219  @retval Others               Fail to identify the user.
    2220  
     2220
    22212221**/
    22222222EFI_STATUS
     
    22442244  }
    22452245  ASSERT (IdentifyInfo != NULL);
    2246  
     2246
    22472247  //
    22482248  // Initialize the container for dynamic opcodes.
     
    23542354        return EFI_SUCCESS;
    23552355      }
    2356  
     2356
    23572357      //
    23582358      // Initialize the container for dynamic opcodes.
     
    23602360      StartOpCodeHandle = HiiAllocateOpCodeHandle ();
    23612361      ASSERT (StartOpCodeHandle != NULL);
    2362  
     2362
    23632363      EndOpCodeHandle = HiiAllocateOpCodeHandle ();
    23642364      ASSERT (EndOpCodeHandle != NULL);
    2365  
     2365
    23662366      //
    23672367      // Create Hii Extend Label OpCode.
     
    23752375      StartLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;
    23762376      StartLabel->Number        = LABEL_USER_NAME;
    2377  
     2377
    23782378      EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (
    23792379                                          EndOpCodeHandle,
     
    23842384      EndLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;
    23852385      EndLabel->Number        = LABEL_END;
    2386  
     2386
    23872387      //
    23882388      // Add all the user profile in the user profile database.
     
    23922392        AddUserSelection ((UINT16)(LABEL_USER_NAME + Index), User, StartOpCodeHandle);
    23932393      }
    2394  
     2394
    23952395      HiiUpdateForm (
    23962396        mCallbackInfo->HiiHandle, // HII handle
     
    24002400        EndOpCodeHandle           // Replace data
    24012401        );
    2402  
     2402
    24032403      HiiFreeOpCodeHandle (StartOpCodeHandle);
    24042404      HiiFreeOpCodeHandle (EndOpCodeHandle);
    2405  
     2405
    24062406      return EFI_SUCCESS;
    24072407    }
     
    24152415    if (QuestionId >= LABEL_PROVIDER_NAME) {
    24162416      //
    2417       // QuestionId comes from the second Form (Select a Credential Provider if identity 
     2417      // QuestionId comes from the second Form (Select a Credential Provider if identity
    24182418      // policy is OR type). Identify the user by the selected provider.
    24192419      //
     
    24262426    }
    24272427    break;
    2428    
     2428
    24292429  case EFI_BROWSER_ACTION_CHANGING:
    24302430    //
     
    24832483/**
    24842484  This function construct user profile database from user data saved in the Flash.
    2485   If no user is found in Flash, add one default user "administrator" in the user 
     2485  If no user is found in Flash, add one default user "administrator" in the user
    24862486  profile database.
    24872487
    24882488  @retval EFI_SUCCESS            Init user profile database successfully.
    24892489  @retval Others                 Fail to init user profile database.
    2490  
     2490
    24912491**/
    24922492EFI_STATUS
     
    25222522    return EFI_OUT_OF_RESOURCES;
    25232523  }
    2524  
     2524
    25252525  //
    25262526  // Get all user proifle entries.
     
    25322532    //
    25332533    UnicodeSPrint (
    2534       VarName, 
     2534      VarName,
    25352535      sizeof (VarName),
    2536       L"User%04x", 
     2536      L"User%04x",
    25372537      Index
    25382538      );
     
    25622562      break;
    25632563    }
    2564    
     2564
    25652565    //
    25662566    // Check variable attributes.
     
    25702570      continue;
    25712571    }
    2572    
     2572
    25732573    //
    25742574    // Add user profile to the user profile database.
     
    26022602    return Status;
    26032603  }
    2604  
     2604
    26052605  //
    26062606  // Check whether the user profile database is empty.
     
    26292629  UINTN       HandleCount;
    26302630  EFI_HANDLE  *HandleBuf;
    2631   UINTN       Index; 
     2631  UINTN       Index;
    26322632
    26332633  if (mProviderDb != NULL) {
     
    26582658  //
    26592659  mProviderDb = AllocateZeroPool (
    2660                   sizeof (CREDENTIAL_PROVIDER_INFO) - 
    2661                   sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) + 
     2660                  sizeof (CREDENTIAL_PROVIDER_INFO) -
     2661                  sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) +
    26622662                  HandleCount * sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *)
    26632663                  );
     
    28162816  CallbackInfo->FormBrowser2  = FormBrowser2;
    28172817  CallbackInfo->DriverHandle  = NULL;
    2818  
     2818
    28192819  //
    28202820  // Install Device Path Protocol and Config Access protocol to driver handle.
     
    28902890    return Status;
    28912891  }
    2892  
     2892
    28932893  //
    28942894  // Find user with the specified user ID.
     
    29092909    return EFI_NOT_READY;
    29102910  }
    2911  
     2911
    29122912  return Status;
    29132913}
     
    29182918
    29192919  @param[in]   ProtocolGuid   Points to the protocol guid of sonsole .
    2920  
     2920
    29212921  @retval TRUE     The given console is ready.
    29222922  @retval FALSE    The given console is not ready.
    2923  
     2923
    29242924**/
    29252925BOOLEAN
    29262926CheckConsole (
    2927   EFI_GUID                     *ProtocolGuid 
     2927  EFI_GUID                     *ProtocolGuid
    29282928  )
    29292929{
     
    29312931  UINTN                        HandleCount;
    29322932  EFI_HANDLE                   *HandleBuf;
    2933   UINTN                        Index; 
     2933  UINTN                        Index;
    29342934  EFI_DEVICE_PATH_PROTOCOL     *DevicePath;
    2935  
     2935
    29362936  //
    29372937  // Try to find all the handle driver.
     
    29572957    }
    29582958  }
    2959   FreePool (HandleBuf); 
     2959  FreePool (HandleBuf);
    29602960  return FALSE;
    29612961}
     
    29672967  @retval TRUE     The console is ready.
    29682968  @retval FALSE    The console is not ready.
    2969  
     2969
    29702970**/
    29712971BOOLEAN
     
    29832983    }
    29842984  }
    2985  
     2985
    29862986  return TRUE;
    29872987}
     
    30393039    }
    30403040  }
    3041  
     3041
    30423042  //
    30433043  // Find and login the default & AutoLogon user.
     
    30603060    }
    30613061  }
    3062  
     3062
    30633063  if (!IsConsoleReady ()) {
    30643064    //
     
    30803080                                 NULL
    30813081                                 );
    3082  
     3082
    30833083  if (mIdentified) {
    30843084    *User = (USER_PROFILE_ENTRY *) mCurrentUser;
     
    30863086    return EFI_SUCCESS;
    30873087  }
    3088  
     3088
    30893089  return EFI_ACCESS_DENIED;
    30903090}
     
    30933093/**
    30943094  An empty function to pass error checking of CreateEventEx ().
    3095  
     3095
    30963096  @param  Event         Event whose notification function is being invoked.
    30973097  @param  Context       Pointer to the notification function's context,
     
    31383138  Create a new user profile.
    31393139
    3140   This function creates a new user profile with only a new user identifier attached and returns 
     3140  This function creates a new user profile with only a new user identifier attached and returns
    31413141  its handle. The user profile is non-volatile, but the handle User can change across reboots.
    31423142
    31433143  @param[in]  This               Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
    3144   @param[out] User               On return, points to the new user profile handle. 
     3144  @param[out] User               On return, points to the new user profile handle.
    31453145                                 The user profile handle is unique only during this boot.
    3146  
     3146
    31473147  @retval EFI_SUCCESS            User profile was successfully created.
    3148   @retval EFI_ACCESS_DENIED      Current user does not have sufficient permissions to create a 
     3148  @retval EFI_ACCESS_DENIED      Current user does not have sufficient permissions to create a
    31493149                                 user profile.
    31503150  @retval EFI_UNSUPPORTED        Creation of new user profiles is not supported.
    31513151  @retval EFI_INVALID_PARAMETER  The User parameter is NULL.
    3152  
     3152
    31533153**/
    31543154EFI_STATUS
     
    31733173    }
    31743174  }
    3175  
     3175
    31763176  //
    31773177  // Create new user profile
     
    31893189
    31903190  @param[in] This                Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
    3191   @param[in] User                User profile handle. 
     3191  @param[in] User                User profile handle.
    31923192
    31933193  @retval EFI_SUCCESS            User profile was successfully deleted.
     
    31963196  @retval EFI_UNSUPPORTED        Deletion of new user profiles is not supported.
    31973197  @retval EFI_INVALID_PARAMETER  User does not refer to a valid user profile.
    3198  
     3198
    31993199**/
    32003200EFI_STATUS
     
    32103210    return EFI_INVALID_PARAMETER;
    32113211  }
    3212  
     3212
    32133213  //
    32143214  // Check the right of the current user.
     
    32173217    return EFI_ACCESS_DENIED;
    32183218  }
    3219  
     3219
    32203220  //
    32213221  // Delete user profile.
     
    32363236  Enumerate all of the enrolled users on the platform.
    32373237
    3238   This function returns the next enrolled user profile. To retrieve the first user profile handle, 
    3239   point User at a NULL. Each subsequent call will retrieve another user profile handle until there 
    3240   are no more, at which point User will point to NULL. 
     3238  This function returns the next enrolled user profile. To retrieve the first user profile handle,
     3239  point User at a NULL. Each subsequent call will retrieve another user profile handle until there
     3240  are no more, at which point User will point to NULL.
    32413241
    32423242  @param[in]      This           Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
    3243   @param[in, out] User           On entry, points to the previous user profile handle or NULL to 
     3243  @param[in, out] User           On entry, points to the previous user profile handle or NULL to
    32443244                                 start enumeration. On exit, points to the next user profile handle
    32453245                                 or NULL if there are no more user profiles.
    32463246
    3247   @retval EFI_SUCCESS            Next enrolled user profile successfully returned. 
     3247  @retval EFI_SUCCESS            Next enrolled user profile successfully returned.
    32483248  @retval EFI_ACCESS_DENIED      Next enrolled user profile was not successfully returned.
    32493249  @retval EFI_INVALID_PARAMETER  The User parameter is NULL.
     
    32613261    return EFI_INVALID_PARAMETER;
    32623262  }
    3263  
     3263
    32643264  Status = FindUserProfile ((USER_PROFILE_ENTRY **) User, TRUE, NULL);
    32653265  if (EFI_ERROR (Status)) {
     
    32763276  @param[out] CurrentUser        On return, points to the current user profile handle.
    32773277
    3278   @retval EFI_SUCCESS            Current user profile handle returned successfully. 
     3278  @retval EFI_SUCCESS            Current user profile handle returned successfully.
    32793279  @retval EFI_INVALID_PARAMETER  The CurrentUser parameter is NULL.
    3280  
     3280
    32813281**/
    32823282EFI_STATUS
     
    32863286  OUT       EFI_USER_PROFILE_HANDLE             *CurrentUser
    32873287  )
    3288 { 
     3288{
    32893289  //
    32903290  // Get current user profile.
     
    33043304  Identify the user and, if authenticated, returns the user handle and changes the current
    33053305  user profile. All user information marked as private in a previously selected profile
    3306   is no longer available for inspection. 
    3307   Whenever the current user profile is changed then the an event with the GUID 
     3306  is no longer available for inspection.
     3307  Whenever the current user profile is changed then the an event with the GUID
    33083308  EFI_EVENT_GROUP_USER_PROFILE_CHANGED is signaled.
    33093309
     
    33153315  @retval EFI_ACCESS_DENIED      User was not successfully identified.
    33163316  @retval EFI_INVALID_PARAMETER  The User parameter is NULL.
    3317  
     3317
    33183318**/
    33193319EFI_STATUS
     
    33343334    return EFI_SUCCESS;
    33353335  }
    3336  
     3336
    33373337  //
    33383338  // Identify user
     
    33423342    return EFI_ACCESS_DENIED;
    33433343  }
    3344  
     3344
    33453345  //
    33463346  // Publish the user info into the EFI system configuration table.
     
    33593359
    33603360  This function searches all user profiles for the specified user information record.
    3361   The search starts with the user information record handle following UserInfo and 
     3361  The search starts with the user information record handle following UserInfo and
    33623362  continues until either the information is found or there are no more user profiles.
    33633363  A match occurs when the Info.InfoType field matches the user information record
     
    33653365
    33663366  @param[in]      This           Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
    3367   @param[in, out] User           On entry, points to the previously returned user profile 
     3367  @param[in, out] User           On entry, points to the previously returned user profile
    33683368                                 handle, or NULL to start searching with the first user profile.
    33693369                                 On return, points to the user profile handle, or NULL if not
    33703370                                 found.
    33713371  @param[in, out] UserInfo       On entry, points to the previously returned user information
    3372                                  handle, or NULL to start searching with the first. On return, 
     3372                                 handle, or NULL to start searching with the first. On return,
    33733373                                 points to the user information handle of the user information
    3374                                  record, or NULL if not found. Can be NULL, in which case only 
    3375                                  one user information record per user can be returned. 
    3376   @param[in]      Info           Points to the buffer containing the user information to be 
    3377                                  compared to the user information record. If the user information 
    3378                                  record data is empty, then only the user information record type 
    3379                                  is compared. If InfoSize is 0, then the user information record 
     3374                                 record, or NULL if not found. Can be NULL, in which case only
     3375                                 one user information record per user can be returned.
     3376  @param[in]      Info           Points to the buffer containing the user information to be
     3377                                 compared to the user information record. If the user information
     3378                                 record data is empty, then only the user information record type
     3379                                 is compared. If InfoSize is 0, then the user information record
    33803380                                 must be empty.
    33813381
    3382   @param[in]      InfoSize       The size of Info, in bytes. 
     3382  @param[in]      InfoSize       The size of Info, in bytes.
    33833383
    33843384  @retval EFI_SUCCESS            User information was found. User points to the user profile
    33853385                                 handle, and UserInfo points to the user information handle.
    3386   @retval EFI_NOT_FOUND          User information was not found. User points to NULL, and 
     3386  @retval EFI_NOT_FOUND          User information was not found. User points to NULL, and
    33873387                                 UserInfo points to NULL.
    3388   @retval EFI_INVALID_PARAMETER  User is NULL. Or Info is NULL.                           
    3389  
     3388  @retval EFI_INVALID_PARAMETER  User is NULL. Or Info is NULL.
     3389
    33903390**/
    33913391EFI_STATUS
     
    34183418    }
    34193419  }
    3420   Size = Info->InfoSize; 
    3421  
     3420  Size = Info->InfoSize;
     3421
    34223422  //
    34233423  // Find user profile accdoring to user information.
     
    34363436    return EFI_NOT_FOUND;
    34373437  }
    3438  
     3438
    34393439  return EFI_SUCCESS;
    34403440}
     
    34443444  Return information attached to the user.
    34453445
    3446   This function returns user information. The format of the information is described in User 
    3447   Information. The function may return EFI_ACCESS_DENIED if the information is marked private 
    3448   and the handle specified by User is not the current user profile. The function may return 
    3449   EFI_ACCESS_DENIED if the information is marked protected and the information is associated 
     3446  This function returns user information. The format of the information is described in User
     3447  Information. The function may return EFI_ACCESS_DENIED if the information is marked private
     3448  and the handle specified by User is not the current user profile. The function may return
     3449  EFI_ACCESS_DENIED if the information is marked protected and the information is associated
    34503450  with a credential provider for which the user has not been authenticated.
    34513451
    34523452  @param[in]      This           Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
    3453   @param[in]      User           Handle of the user whose profile will be retrieved. 
    3454   @param[in]      UserInfo       Handle of the user information data record.   
    3455   @param[out]     Info           On entry, points to a buffer of at least *InfoSize bytes. On exit, 
    3456                                  holds the user information. If the buffer is too small to hold the 
    3457                                  information, then EFI_BUFFER_TOO_SMALL is returned and InfoSize is 
    3458                                  updated to contain the number of bytes actually required. 
    3459   @param[in, out] InfoSize       On entry, points to the size of Info. On return, points to the size 
    3460                                  of the user information. 
     3453  @param[in]      User           Handle of the user whose profile will be retrieved.
     3454  @param[in]      UserInfo       Handle of the user information data record.
     3455  @param[out]     Info           On entry, points to a buffer of at least *InfoSize bytes. On exit,
     3456                                 holds the user information. If the buffer is too small to hold the
     3457                                 information, then EFI_BUFFER_TOO_SMALL is returned and InfoSize is
     3458                                 updated to contain the number of bytes actually required.
     3459  @param[in, out] InfoSize       On entry, points to the size of Info. On return, points to the size
     3460                                 of the user information.
    34613461
    34623462  @retval EFI_SUCCESS            Information returned successfully.
    3463   @retval EFI_ACCESS_DENIED      The information about the specified user cannot be accessed by the 
     3463  @retval EFI_ACCESS_DENIED      The information about the specified user cannot be accessed by the
    34643464                                 current user.
    3465   @retval EFI_BUFFER_TOO_SMALL   The number of bytes specified by *InfoSize is too small to hold the 
     3465  @retval EFI_BUFFER_TOO_SMALL   The number of bytes specified by *InfoSize is too small to hold the
    34663466                                 returned data. The actual size required is returned in *InfoSize.
    3467   @retval EFI_NOT_FOUND          User does not refer to a valid user profile or UserInfo does not refer 
     3467  @retval EFI_NOT_FOUND          User does not refer to a valid user profile or UserInfo does not refer
    34683468                                 to a valid user info handle.
    34693469  @retval EFI_INVALID_PARAMETER  Info is NULL or InfoSize is NULL.
    3470  
     3470
    34713471**/
    34723472EFI_STATUS
     
    34893489    return EFI_INVALID_PARAMETER;
    34903490  }
    3491  
     3491
    34923492  if ((User == NULL) || (UserInfo == NULL)) {
    34933493    return EFI_NOT_FOUND;
    34943494  }
    3495  
     3495
    34963496  Status = GetUserInfo (User, UserInfo, Info, InfoSize, TRUE);
    34973497  if (EFI_ERROR (Status)) {
     
    35083508  Add or update user information.
    35093509
    3510   This function changes user information.  If NULL is pointed to by UserInfo, then a new user 
    3511   information record is created and its handle is returned in UserInfo. Otherwise, the existing 
     3510  This function changes user information.  If NULL is pointed to by UserInfo, then a new user
     3511  information record is created and its handle is returned in UserInfo. Otherwise, the existing
    35123512  one is replaced.
    3513   If EFI_USER_INFO_IDENITTY_POLICY_RECORD is changed, it is the caller's responsibility to keep 
     3513  If EFI_USER_INFO_IDENITTY_POLICY_RECORD is changed, it is the caller's responsibility to keep
    35143514  it to be synced with the information on credential providers.
    3515   If EFI_USER_INFO_EXCLUSIVE is specified in Info and a user information record of the same 
     3515  If EFI_USER_INFO_EXCLUSIVE is specified in Info and a user information record of the same
    35163516  type already exists in the user profile, then EFI_ACCESS_DENIED will be returned and UserInfo
    35173517  will point to the handle of the existing record.
    35183518
    35193519  @param[in]      This            Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
    3520   @param[in]      User            Handle of the user whose profile will be retrieved. 
    3521   @param[in, out] UserInfo        Handle of the user information data record.   
    3522   @param[in]      Info            On entry, points to a buffer of at least *InfoSize bytes. On exit, 
    3523                                   holds the user information. If the buffer is too small to hold the 
    3524                                   information, then EFI_BUFFER_TOO_SMALL is returned and InfoSize is 
    3525                                   updated to contain the number of bytes actually required. 
    3526   @param[in]      InfoSize        On entry, points to the size of Info. On return, points to the size 
    3527                                   of the user information. 
     3520  @param[in]      User            Handle of the user whose profile will be retrieved.
     3521  @param[in, out] UserInfo        Handle of the user information data record.
     3522  @param[in]      Info            On entry, points to a buffer of at least *InfoSize bytes. On exit,
     3523                                  holds the user information. If the buffer is too small to hold the
     3524                                  information, then EFI_BUFFER_TOO_SMALL is returned and InfoSize is
     3525                                  updated to contain the number of bytes actually required.
     3526  @param[in]      InfoSize        On entry, points to the size of Info. On return, points to the size
     3527                                  of the user information.
    35283528
    35293529  @retval EFI_SUCCESS             Information returned successfully.
    35303530  @retval EFI_ACCESS_DENIED       The record is exclusive.
    3531   @retval EFI_SECURITY_VIOLATION  The current user does not have permission to change the specified 
     3531  @retval EFI_SECURITY_VIOLATION  The current user does not have permission to change the specified
    35323532                                  user profile or user information record.
    3533   @retval EFI_NOT_FOUND           User does not refer to a valid user profile or UserInfo does not 
     3533  @retval EFI_NOT_FOUND           User does not refer to a valid user profile or UserInfo does not
    35343534                                  refer to a valid user info handle.
    3535   @retval EFI_INVALID_PARAMETER   UserInfo is NULL or Info is NULL. 
     3535  @retval EFI_INVALID_PARAMETER   UserInfo is NULL or Info is NULL.
    35363536**/
    35373537EFI_STATUS
     
    35503550    return EFI_INVALID_PARAMETER;
    35513551  }
    3552  
     3552
    35533553  //
    35543554  // Check the right of the current user.
     
    35623562        return EFI_SECURITY_VIOLATION;
    35633563      }
    3564      
     3564
    35653565      if (!CheckCurrentUserAccessRight (EFI_USER_INFO_ACCESS_ENROLL_OTHERS)) {
    35663566        //
     
    35823582    }
    35833583  }
    3584  
     3584
    35853585  //
    35863586  // Modify user information.
     
    35893589  if (EFI_ERROR (Status)) {
    35903590    if (Status == EFI_ACCESS_DENIED) {
    3591       return EFI_ACCESS_DENIED;     
     3591      return EFI_ACCESS_DENIED;
    35923592    }
    35933593    return EFI_SECURITY_VIOLATION;
     
    36003600  Called by credential provider to notify of information change.
    36013601
    3602   This function allows the credential provider to notify the User Identity Manager when user status 
     3602  This function allows the credential provider to notify the User Identity Manager when user status
    36033603  has changed.
    3604   If the User Identity Manager doesn't support asynchronous changes in credentials, then this function 
    3605   should return EFI_UNSUPPORTED. 
    3606   If current user does not exist, and the credential provider can identify a user, then make the user 
     3604  If the User Identity Manager doesn't support asynchronous changes in credentials, then this function
     3605  should return EFI_UNSUPPORTED.
     3606  If current user does not exist, and the credential provider can identify a user, then make the user
    36073607  to be current user and signal the EFI_EVENT_GROUP_USER_PROFILE_CHANGED event.
    3608   If current user already exists, and the credential provider can identify another user, then switch 
     3608  If current user already exists, and the credential provider can identify another user, then switch
    36093609  current user to the newly identified user, and signal the EFI_EVENT_GROUP_USER_PROFILE_CHANGED event.
    3610   If current user was identified by this credential provider and now the credential provider cannot identify 
     3610  If current user was identified by this credential provider and now the credential provider cannot identify
    36113611  current user, then logout current user and signal the EFI_EVENT_GROUP_USER_PROFILE_CHANGED event.
    36123612
    36133613  @param[in] This          Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
    3614   @param[in] Changed       Handle on which is installed an instance of the EFI_USER_CREDENTIAL2_PROTOCOL 
     3614  @param[in] Changed       Handle on which is installed an instance of the EFI_USER_CREDENTIAL2_PROTOCOL
    36153615                           where the user has changed.
    36163616
     
    36183618  @retval EFI_NOT_READY    The function was called while the specified credential provider was not selected.
    36193619  @retval EFI_UNSUPPORTED  The User Identity Manager doesn't support asynchronous notifications.
    3620  
     3620
    36213621**/
    36223622EFI_STATUS
     
    36263626  IN        EFI_HANDLE                          Changed
    36273627  )
    3628 {   
     3628{
    36293629  return EFI_UNSUPPORTED;
    36303630}
     
    36423642  @retval EFI_SUCCESS        User information deleted successfully.
    36433643  @retval EFI_NOT_FOUND      User information record UserInfo does not exist in the user profile.
    3644   @retval EFI_ACCESS_DENIED  The current user does not have permission to delete this user information. 
    3645  
     3644  @retval EFI_ACCESS_DENIED  The current user does not have permission to delete this user information.
     3645
    36463646**/
    36473647EFI_STATUS
     
    36583658    return EFI_INVALID_PARAMETER;
    36593659  }
    3660  
     3660
    36613661  //
    36623662  // Check the right of the current user.
     
    36673667    }
    36683668  }
    3669  
     3669
    36703670  //
    36713671  // Delete user information.
     
    36773677    }
    36783678    return EFI_ACCESS_DENIED;
    3679   } 
     3679  }
    36803680  return EFI_SUCCESS;
    36813681}
     
    36853685  Enumerate user information of all the enrolled users on the platform.
    36863686
    3687   This function returns the next user information record. To retrieve the first user   
    3688   information record handle, point UserInfo at a NULL. Each subsequent call will retrieve 
    3689   another user information record handle until there are no more, at which point UserInfo 
    3690   will point to NULL. 
     3687  This function returns the next user information record. To retrieve the first user
     3688  information record handle, point UserInfo at a NULL. Each subsequent call will retrieve
     3689  another user information record handle until there are no more, at which point UserInfo
     3690  will point to NULL.
    36913691
    36923692  @param[in]      This           Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
     
    36973697  @retval EFI_NOT_FOUND          No more user information found.
    36983698  @retval EFI_INVALID_PARAMETER  UserInfo is NULL.
    3699  
     3699
    37003700**/
    37013701EFI_STATUS
     
    37553755                  &gUserIdentifyManager
    37563756                  );
    3757   ASSERT_EFI_ERROR (Status); 
     3757  ASSERT_EFI_ERROR (Status);
    37583758
    37593759  LoadDeferredImageInit (ImageHandle);
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.h

    r48674 r58466  
    11/** @file
    22  The header file for User identify Manager driver.
    3    
     3
    44Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    240240
    241241  This function searches all user profiles for the specified user information record.
    242   The search starts with the user information record handle following UserInfo and 
     242  The search starts with the user information record handle following UserInfo and
    243243  continues until either the information is found or there are no more user profiles.
    244244  A match occurs when the Info.InfoType field matches the user information record
    245   type and the user information record data matches the portion of Info passed the 
     245  type and the user information record data matches the portion of Info passed the
    246246  EFI_USER_INFO header.
    247247
    248248  @param[in]      This     Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
    249   @param[in, out] User     On entry, points to the previously returned user profile 
     249  @param[in, out] User     On entry, points to the previously returned user profile
    250250                           handle, or NULL to start searching with the first user profile.
    251251                           On return, points to the user profile handle, or NULL if not
    252252                           found.
    253253  @param[in, out] UserInfo On entry, points to the previously returned user information
    254                            handle, or NULL to start searching with the first. On return, 
     254                           handle, or NULL to start searching with the first. On return,
    255255                           points to the user information handle of the user information
    256                            record, or NULL if not found. Can be NULL, in which case only 
    257                            one user information record per user can be returned. 
    258   @param[in]      Info     Points to the buffer containing the user information to be 
    259                            compared to the user information record. If NULL, then only 
    260                            the user information record type is compared. If InfoSize is 0, 
     256                           record, or NULL if not found. Can be NULL, in which case only
     257                           one user information record per user can be returned.
     258  @param[in]      Info     Points to the buffer containing the user information to be
     259                           compared to the user information record. If NULL, then only
     260                           the user information record type is compared. If InfoSize is 0,
    261261                           then the user information record must be empty.
    262262
    263   @param[in]      InfoSize The size of Info, in bytes. 
     263  @param[in]      InfoSize The size of Info, in bytes.
    264264
    265265  @retval EFI_SUCCESS      User information was found. User points to the user profile handle,
    266266                           and UserInfo points to the user information handle.
    267   @retval EFI_NOT_FOUND    User information was not found. User points to NULL and UserInfo 
     267  @retval EFI_NOT_FOUND    User information was not found. User points to NULL and UserInfo
    268268                           points to NULL.
    269  
     269
    270270**/
    271271EFI_STATUS
     
    410410  IN OUT    EFI_USER_INFO_HANDLE                *UserInfo
    411411  );
    412  
     412
    413413#endif
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerData.h

    r48674 r58466  
    11/** @file
    22  Data structure used by the user identify manager driver.
    3    
     3
    44Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerDxe.inf

    r58459 r58466  
    33#
    44#  This module manages user information and produces user manager protocol.
    5 # 
     5#
    66# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
    77# This program and the accompanying materials
     
    4949  gEfiIfrTianoGuid                              ## SOMETIMES_CONSUMES  ## GUID
    5050  gEfiEventUserProfileChangedGuid               ## SOMETIMES_PRODUCES  ## Event
    51  
     51
    5252  ## SOMETIMES_PRODUCES                         ## Variable:L"Userxxxx"
    5353  ## SOMETIMES_CONSUMES                         ## Variable:L"Userxxxx"
     
    6565  gEfiHiiConfigAccessProtocolGuid               ## PRODUCES
    6666  gEfiDevicePathProtocolGuid                    ## PRODUCES
    67  
     67
    6868  ## PRODUCES
    6969  ## SOMETIMES_PRODUCES                         ## SystemTable
    70   gEfiUserManagerProtocolGuid                   
     70  gEfiUserManagerProtocolGuid
    7171
    7272[Depex]
    73   gEfiHiiDatabaseProtocolGuid   AND 
    74   gEfiHiiStringProtocolGuid     AND 
    75   gEfiFormBrowser2ProtocolGuid 
     73  gEfiHiiDatabaseProtocolGuid   AND
     74  gEfiHiiStringProtocolGuid     AND
     75  gEfiFormBrowser2ProtocolGuid
    7676
    7777[UserExtensions.TianoCore."ExtraFiles"]
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerStrings.uni

    • Property svn:mime-type changed from application/octet-stream to text/plain;encoding=UTF-16LE
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerVfr.Vfr

    • Property svn:eol-style set to native
    r58459 r58466  
    33
    44Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    1515#include "UserIdentifyManagerData.h"
    1616
    17 formset 
     17formset
    1818  guid      = USER_IDENTIFY_MANAGER_GUID,
    19   title     = STRING_TOKEN(STR_TITLE), 
    20   help      = STRING_TOKEN(STR_NULL_STRING), 
     19  title     = STRING_TOKEN(STR_TITLE),
     20  help      = STRING_TOKEN(STR_NULL_STRING),
    2121  classguid = USER_IDENTIFY_MANAGER_GUID,
    22  
     22
    2323  form formid = FORMID_USER_FORM,
    24     title = STRING_TOKEN(STR_USER_SELECT);     
     24    title = STRING_TOKEN(STR_USER_SELECT);
    2525
    2626    suppressif TRUE;
     
    3333
    3434    label LABEL_USER_NAME;
    35     label LABEL_END; 
     35    label LABEL_END;
    3636  endform;
    37  
     37
    3838  form formid = FORMID_PROVIDER_FORM,
    3939    title = STRING_TOKEN(STR_PROVIDER_SELECT);
    4040    label LABEL_PROVIDER_NAME;
    4141    label LABEL_END;
    42   endform; 
     42  endform;
    4343endformset;
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c

    r58459 r58466  
    11/** @file
    22  The functions for access policy modification.
    3    
     3
    44Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    1616
    1717/**
    18   Collect all the access policy data to mUserInfo.AccessPolicy, 
     18  Collect all the access policy data to mUserInfo.AccessPolicy,
    1919  and save it to user profile.
    2020
     
    3939  mUserInfo.AccessPolicyModified  = TRUE;
    4040  OffSet                          = 0;
    41  
     41
    4242  //
    4343  // Save access right.
     
    5252  CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
    5353  OffSet += sizeof (Control);
    54  
     54
    5555  //
    5656  // Save access setup.
     
    6262
    6363  Control.Type = EFI_USER_INFO_ACCESS_SETUP;
    64   Control.Size = (UINT32) Size; 
     64  Control.Size = (UINT32) Size;
    6565  CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
    6666  OffSet += sizeof (Control);
    67  
     67
    6868  if (mAccessInfo.AccessSetup == ACCESS_SETUP_NORMAL) {
    6969    CopyGuid ((EFI_GUID *) (mUserInfo.AccessPolicy + OffSet), &gEfiUserInfoAccessSetupNormalGuid);
     
    7474  }
    7575  OffSet += sizeof (EFI_GUID);
    76  
     76
    7777  //
    7878  // Save access of boot order.
     
    8484
    8585  Control.Type = EFI_USER_INFO_ACCESS_BOOT_ORDER;
    86   Control.Size = (UINT32) Size; 
     86  Control.Size = (UINT32) Size;
    8787  CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
    8888  OffSet += sizeof (Control);
     
    9090  CopyMem ((UINT8 *) (mUserInfo.AccessPolicy + OffSet), &mAccessInfo.AccessBootOrder, sizeof (UINT32));
    9191  OffSet += sizeof (UINT32);
    92  
     92
    9393  //
    9494  // Save permit load.
     
    101101
    102102    Control.Type = EFI_USER_INFO_ACCESS_PERMIT_LOAD;
    103     Control.Size = (UINT32) Size; 
     103    Control.Size = (UINT32) Size;
    104104    CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
    105105    OffSet += sizeof (Control);
    106  
     106
    107107    CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.LoadPermit, mAccessInfo.LoadPermitLen);
    108108    OffSet += mAccessInfo.LoadPermitLen;
    109109  }
    110  
     110
    111111  //
    112112  // Save forbid load.
     
    119119
    120120    Control.Type = EFI_USER_INFO_ACCESS_FORBID_LOAD;
    121     Control.Size = (UINT32) Size; 
     121    Control.Size = (UINT32) Size;
    122122    CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
    123123    OffSet += sizeof (Control);
    124    
     124
    125125    CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.LoadForbid, mAccessInfo.LoadForbidLen);
    126126    OffSet += mAccessInfo.LoadForbidLen;
    127127  }
    128  
     128
    129129  //
    130130  // Save permit connect.
     
    137137
    138138    Control.Type = EFI_USER_INFO_ACCESS_PERMIT_CONNECT;
    139     Control.Size = (UINT32) Size; 
     139    Control.Size = (UINT32) Size;
    140140    CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
    141141    OffSet += sizeof (Control);
    142    
     142
    143143    CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.ConnectPermit, mAccessInfo.ConnectPermitLen);
    144144    OffSet += mAccessInfo.ConnectPermitLen;
    145145  }
    146  
     146
    147147  //
    148148  // Save forbid connect.
     
    155155
    156156    Control.Type = EFI_USER_INFO_ACCESS_FORBID_CONNECT;
    157     Control.Size = (UINT32) Size; 
     157    Control.Size = (UINT32) Size;
    158158    CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control));
    159159    OffSet += sizeof (Control);
    160    
     160
    161161    CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.ConnectForbid, mAccessInfo.ConnectForbidLen);
    162162    OffSet += mAccessInfo.ConnectForbidLen;
     
    265265
    266266/**
    267   Check whether the DevicePath is in the device path forbid list 
     267  Check whether the DevicePath is in the device path forbid list
    268268  (mAccessInfo.LoadForbid).
    269269
    270270  @param[in]  DevicePath           Points to device path.
    271  
     271
    272272  @retval TRUE     The DevicePath is in the device path forbid list.
    273273  @retval FALSE    The DevicePath is not in the device path forbid list.
     
    331331  OrderSize = 0;
    332332  Status    = gRT->GetVariable (
    333                      L"DriverOrder", 
    334                      &gEfiGlobalVariableGuid, 
    335                      NULL, 
    336                      &OrderSize, 
     333                     L"DriverOrder",
     334                     &gEfiGlobalVariableGuid,
     335                     NULL,
     336                     &OrderSize,
    337337                     NULL
    338338                     );
     
    347347
    348348  Status = gRT->GetVariable (
    349                   L"DriverOrder", 
    350                   &gEfiGlobalVariableGuid, 
    351                   NULL, 
    352                   &OrderSize, 
     349                  L"DriverOrder",
     350                  &gEfiGlobalVariableGuid,
     351                  NULL,
     352                  &OrderSize,
    353353                  Order
    354354                  );
     
    356356    return ;
    357357  }
    358  
     358
    359359  //
    360360  // Initialize the container for dynamic opcodes.
     
    401401      continue;
    402402    }
    403    
     403
    404404    //
    405405    // Check whether the driver is already forbidden.
    406406    //
    407    
     407
    408408    VarPtr = Var;
    409409    //
     
    546546{
    547547  //
    548   // Note: 
     548  // Note:
    549549  // As no architect protocol/interface to be called in ConnectController()
    550550  // to verify the device path, just add a place holder for permitted connect
     
    564564{
    565565  //
    566   // Note: 
     566  // Note:
    567567  // As no architect protocol/interface to be called in ConnectController()
    568568  // to verify the device path, just add a place holder for forbidden connect
     
    573573
    574574/**
    575   Delete the specified device path by DriverIndex from the forbid device path 
     575  Delete the specified device path by DriverIndex from the forbid device path
    576576  list (mAccessInfo.LoadForbid).
    577577
    578578  @param[in]  DriverIndex   The index of driver in forbidden device path list.
    579  
     579
    580580**/
    581581VOID
     
    599599    DriverIndex--;
    600600  }
    601  
     601
    602602  //
    603603  // Specified device path found.
     
    609609    if (OffLen > 0) {
    610610      CopyMem (
    611         mAccessInfo.LoadForbid + OffSet, 
    612         mAccessInfo.LoadForbid + OffSet + DPSize, 
     611        mAccessInfo.LoadForbid + OffSet,
     612        mAccessInfo.LoadForbid + OffSet + DPSize,
    613613        OffLen
    614614        );
     
    620620
    621621/**
    622   Add the specified device path by DriverIndex to the forbid device path 
     622  Add the specified device path by DriverIndex to the forbid device path
    623623  list (mAccessInfo.LoadForbid).
    624624
    625625  @param[in]  DriverIndex   The index of driver saved in driver options.
    626  
     626
    627627**/
    628628VOID
     
    646646    return;
    647647  }
    648  
     648
    649649  //
    650650  // Save forbid load driver.
    651651  //
    652  
     652
    653653  VarPtr = Var;
    654654  //
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyIdentityPolicy.c

    r48674 r58466  
    11/** @file
    22  The functions for identification policy modification.
    3    
     3
    44Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    2121
    2222  @param[in] NewGuid       Points to the credential provider guid.
    23  
     23
    2424  @retval TRUE     The NewGuid was found in the identity policy.
    2525  @retval FALSE    The NewGuid was not found.
     
    5353    Offset += Identity->Length;
    5454  }
    55  
     55
    5656  return FALSE;
    5757}
     
    7171EnrollUserOnProvider (
    7272  IN  EFI_USER_INFO_IDENTITY_POLICY              *Identity,
    73   IN  EFI_USER_PROFILE_HANDLE                    User 
     73  IN  EFI_USER_PROFILE_HANDLE                    User
    7474  )
    7575{
    7676  UINTN                          Index;
    7777  EFI_USER_CREDENTIAL2_PROTOCOL  *UserCredential;
    78  
     78
    7979  //
    8080  // Find the specified credential provider.
     
    8787  }
    8888
    89   return EFI_NOT_FOUND; 
     89  return EFI_NOT_FOUND;
    9090}
    9191
     
    104104DeleteUserOnProvider (
    105105  IN  EFI_USER_INFO_IDENTITY_POLICY              *Identity,
    106   IN  EFI_USER_PROFILE_HANDLE                    User 
     106  IN  EFI_USER_PROFILE_HANDLE                    User
    107107  )
    108108{
    109109  UINTN                          Index;
    110110  EFI_USER_CREDENTIAL2_PROTOCOL  *UserCredential;
    111  
     111
    112112  //
    113113  // Find the specified credential provider.
     
    120120  }
    121121
    122   return EFI_NOT_FOUND; 
     122  return EFI_NOT_FOUND;
    123123}
    124124
     
    126126/**
    127127  Delete User's credental from all the providers that exist in User's identity policy.
    128  
     128
    129129  @param[in]  IdentityPolicy     Point to User's identity policy.
    130130  @param[in]  IdentityPolicyLen  The length of the identity policy.
     
    136136  IN     UINT8                                *IdentityPolicy,
    137137  IN     UINTN                                 IdentityPolicyLen,
    138   IN     EFI_USER_PROFILE_HANDLE               User 
     138  IN     EFI_USER_PROFILE_HANDLE               User
    139139  )
    140140{
     
    159159/**
    160160  Remove the provider specified by Offset from the new user identification record.
    161  
     161
    162162  @param[in]  IdentityPolicy    Point to user identity item in new identification policy.
    163163  @param[in]  Offset            The item offset in the new identification policy.
     
    188188    //
    189189    // This provider is not the last item in the identification policy, delete it and the connector.
    190     //   
     190    //
    191191    RemainingLen = mUserInfo.NewIdentityPolicyLen - Offset - DeleteLen;
    192192    CopyMem ((UINT8 *) IdentityPolicy, (UINT8 *) IdentityPolicy + DeleteLen, RemainingLen);
    193193  }
    194   mUserInfo.NewIdentityPolicyLen -= DeleteLen; 
     194  mUserInfo.NewIdentityPolicyLen -= DeleteLen;
    195195}
    196196
     
    202202
    203203  @param[in] NewGuid       Points to the credential provider guid.
    204  
     204
    205205**/
    206206VOID
     
    249249    FreePool (mUserInfo.NewIdentityPolicy);
    250250  }
    251  
     251
    252252  //
    253253  // Save credential provider.
     
    326326  @retval TRUE     The policy is a valid identity policy.
    327327  @retval FALSE    The policy is not a valid identity policy.
    328  
     328
    329329**/
    330330BOOLEAN
     
    338338  UINTN                         Offset;
    339339  UINT32                        OpCode;
    340  
     340
    341341  //
    342342  // Check policy expression.
     
    350350    Identity = (EFI_USER_INFO_IDENTITY_POLICY *) (PolicyInfo + Offset);
    351351    switch (Identity->Type) {
    352      
     352
    353353    case EFI_USER_INFO_IDENTITY_TRUE:
    354354      break;
     
    409409/**
    410410  Save the identity policy and update UI with it.
    411  
    412   This funciton will verify the new identity policy, in current implementation, 
     411
     412  This funciton will verify the new identity policy, in current implementation,
    413413  the identity policy can be:  T, P & P & P & ..., P | P | P | ...
    414414  Here, "T" means "True", "P" means "Credential Provider", "&" means "and", "|" means "or".
    415   Other identity policies are not supported. 
     415  Other identity policies are not supported.
    416416
    417417**/
     
    440440    return ;
    441441  }
    442  
     442
    443443  //
    444444  // Update the informantion on credential provider.
     
    448448    return ;
    449449  }
    450  
     450
    451451  //
    452452  // Save new identification policy.
     
    462462  Status = mUserManager->SetInfo (mUserManager, mModifyUser, &UserInfo, Info, Info->InfoSize);
    463463  FreePool (Info);
    464    
     464
    465465  //
    466466  // Update the mUserInfo.IdentityPolicy by mUserInfo.NewIdentityPolicy
     
    474474  mUserInfo.NewIdentityPolicy         = NULL;
    475475  mUserInfo.NewIdentityPolicyLen      = 0;
    476   mUserInfo.NewIdentityPolicyModified = FALSE;   
     476  mUserInfo.NewIdentityPolicyModified = FALSE;
    477477
    478478  //
     
    495495    return ;
    496496  }
    497  
     497
    498498  //
    499499  // Check the identity policy.
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileAdd.c

    r48674 r58466  
    11/** @file
    22  The functions to add a user profile.
    3    
     3
    44Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    1818/**
    1919  Get user name from the popup windows.
    20  
     20
    2121  @param[in, out]  UserNameLen  On entry, point to UserName buffer lengh, in bytes.
    2222                                On exit, point to input user name length, in bytes.
    2323  @param[out]      UserName     The buffer to hold the input user name.
    24  
     24
    2525  @retval EFI_ABORTED           It is given up by pressing 'ESC' key.
    2626  @retval EFI_NOT_READY         Not a valid input at all.
     
    101101  *UserNameLen = NameLen * sizeof (CHAR16);
    102102  CopyMem (UserName, Name, *UserNameLen);
    103  
     103
    104104  return EFI_SUCCESS;
    105105}
     
    113113
    114114  @retval EFI_NOT_READY      The usernme in mAddUserName had been used.
    115   @retval EFI_SUCCESS        Change the user's username successfully with 
     115  @retval EFI_SUCCESS        Change the user's username successfully with
    116116                             username in mAddUserName.
    117117
     
    128128  EFI_USER_PROFILE_HANDLE TempUser;
    129129  EFI_USER_INFO           *NewUserInfo;
    130    
     130
    131131  NewUserInfo = AllocateZeroPool (sizeof (EFI_USER_INFO) + UserNameLen);
    132132  ASSERT (NewUserInfo != NULL);
    133133
    134134  NewUserInfo->InfoType    = EFI_USER_INFO_NAME_RECORD;
    135   NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV | 
    136                              EFI_USER_INFO_PUBLIC | 
     135  NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
     136                             EFI_USER_INFO_PUBLIC |
    137137                             EFI_USER_INFO_EXCLUSIVE;
    138138  NewUserInfo->InfoSize    = (UINT32) (sizeof (EFI_USER_INFO) + UserNameLen);
     
    182182  EFI_USER_INFO_CREATE_DATE Date;
    183183  EFI_USER_INFO             *NewUserInfo;
    184  
     184
    185185  NewUserInfo = AllocateZeroPool (
    186186                  sizeof (EFI_USER_INFO) +
     
    190190
    191191  NewUserInfo->InfoType    = EFI_USER_INFO_CREATE_DATE_RECORD;
    192   NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV | 
    193                              EFI_USER_INFO_PUBLIC | 
     192  NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
     193                             EFI_USER_INFO_PUBLIC |
    194194                             EFI_USER_INFO_EXCLUSIVE;
    195195  NewUserInfo->InfoSize    = sizeof (EFI_USER_INFO) + sizeof (EFI_USER_INFO_CREATE_DATE);
     
    216216  Set the default identity policy of the specified user.
    217217
    218   @param[in]  User               Handle of a user profile. 
     218  @param[in]  User               Handle of a user profile.
    219219
    220220**/
     
    227227  EFI_USER_INFO_HANDLE          UserInfo;
    228228  EFI_USER_INFO                 *NewUserInfo;
    229  
     229
    230230  NewUserInfo = AllocateZeroPool (
    231                   sizeof (EFI_USER_INFO) + 
     231                  sizeof (EFI_USER_INFO) +
    232232                  sizeof (EFI_USER_INFO_IDENTITY_POLICY)
    233233                  );
    234234  ASSERT (NewUserInfo != NULL);
    235  
     235
    236236  Policy                   = (EFI_USER_INFO_IDENTITY_POLICY *) (NewUserInfo + 1);
    237237  Policy->Type             = EFI_USER_INFO_IDENTITY_TRUE;
     
    239239
    240240  NewUserInfo->InfoType    = EFI_USER_INFO_IDENTITY_POLICY_RECORD;
    241   NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV | 
    242                              EFI_USER_INFO_PUBLIC | 
     241  NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
     242                             EFI_USER_INFO_PUBLIC |
    243243                             EFI_USER_INFO_EXCLUSIVE;
    244244  NewUserInfo->InfoSize    = sizeof (EFI_USER_INFO) + Policy->Length;
     
    258258  Set the default access policy of the specified user.
    259259
    260   @param[in]  User               Handle of a user profile. 
     260  @param[in]  User               Handle of a user profile.
    261261
    262262**/
     
    269269  EFI_USER_INFO_HANDLE          UserInfo;
    270270  EFI_USER_INFO                 *NewUserInfo;
    271  
     271
    272272  NewUserInfo = AllocateZeroPool (
    273                   sizeof (EFI_USER_INFO) + 
     273                  sizeof (EFI_USER_INFO) +
    274274                  sizeof (EFI_USER_INFO_ACCESS_CONTROL)
    275275                  );
    276276  ASSERT (NewUserInfo != NULL);
    277  
     277
    278278  Control                  = (EFI_USER_INFO_ACCESS_CONTROL *) (NewUserInfo + 1);
    279279  Control->Type            = EFI_USER_INFO_ACCESS_ENROLL_SELF;
     
    281281
    282282  NewUserInfo->InfoType    = EFI_USER_INFO_ACCESS_POLICY_RECORD;
    283   NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV | 
    284                              EFI_USER_INFO_PUBLIC | 
     283  NewUserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV |
     284                             EFI_USER_INFO_PUBLIC |
    285285                             EFI_USER_INFO_EXCLUSIVE;
    286286  NewUserInfo->InfoSize    = sizeof (EFI_USER_INFO) + Control->Size;
     
    316316  QuestionStr = NULL;
    317317  PromptStr   = NULL;
    318  
     318
    319319  //
    320320  // Get user name to add.
     
    325325    if (Status != EFI_ABORTED) {
    326326      QuestionStr = GetStringById (STRING_TOKEN (STR_GET_USERNAME_FAILED));
    327       PromptStr   = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE)); 
     327      PromptStr   = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
    328328      goto Done;
    329329    }
     
    338338  if (EFI_ERROR (Status)) {
    339339    QuestionStr = GetStringById (STRING_TOKEN (STR_CREATE_PROFILE_FAILED));
    340     PromptStr   = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE)); 
     340    PromptStr   = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
    341341  } else {
    342342    //
     
    346346    if (EFI_ERROR (Status)) {
    347347      QuestionStr = GetStringById (STRING_TOKEN (STR_USER_ALREADY_EXISTED));
    348       PromptStr   = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE)); 
     348      PromptStr   = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
    349349      goto Done;
    350350    }
     
    355355
    356356    QuestionStr = GetStringById (STRING_TOKEN (STR_CREATE_PROFILE_SUCCESS));
    357     PromptStr   = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE)); 
     357    PromptStr   = GetStringById (STRING_TOKEN (STR_STROKE_KEY_CONTINUE));
    358358  }
    359359
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c

    r48674 r58466  
    11/** @file
    22  The functions to delete a user profile.
    3    
     3
    44Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    1818  Get the username from the specified user.
    1919
    20   @param[in]   User              Handle of a user profile. 
     20  @param[in]   User              Handle of a user profile.
    2121
    2222  @retval EFI_STRING_ID          The String Id of the user's username.
    2323
    2424**/
    25 EFI_STRING_ID 
     25EFI_STRING_ID
    2626GetUserName (
    2727  IN  EFI_USER_PROFILE_HANDLE                   User
     
    3636  CHAR16                UserName[USER_NAME_LENGTH];
    3737  EFI_STRING_ID         UserId;
    38  
     38
    3939  //
    4040  // Allocate user information memory.
     
    4343  Info    = AllocateZeroPool (MemSize);
    4444  ASSERT (Info != NULL);
    45  
     45
    4646  //
    4747  // Get user name information.
     
    117117  Add a username item in form.
    118118
    119   @param[in]  User          Points to the user profile whose username is added. 
     119  @param[in]  User          Points to the user profile whose username is added.
    120120  @param[in]  Index         The index of the user in the user name list
    121121  @param[in]  OpCodeHandle  Points to container for dynamic created opcodes.
     
    138138    return ;
    139139  }
    140  
     140
    141141  //
    142142  // Create user name option.
     
    174174  Delete the user specified by UserIndex in user profile database.
    175175
    176   @param[in]  UserIndex       The index of user in the user name list 
     176  @param[in]  UserIndex       The index of user in the user name list
    177177                              to be deleted.
    178178
     
    198198    goto Done;
    199199  }
    200  
     200
    201201  while (UserIndex > 1) {
    202202    Status = mUserManager->GetNext (mUserManager, &User);
     
    233233    DeleteCredentialFromProviders ((UINT8 *)(Info + 1), Info->InfoSize - sizeof (EFI_USER_INFO), User);
    234234    FreePool (Info);
    235    
     235
    236236    Status = mUserManager->Delete (mUserManager, User);
    237237    if (EFI_ERROR (Status)) {
     
    246246      NULL
    247247      );
    248     return ; 
     248    return ;
    249249  }
    250250
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c

    r48674 r58466  
    11/** @file
    2   This driver is a configuration tool for adding, deleting or modifying user 
    3   profiles, including gathering the necessary information to ascertain their 
    4   identity in the future, updating user access policy and identification 
     2  This driver is a configuration tool for adding, deleting or modifying user
     3  profiles, including gathering the necessary information to ascertain their
     4  identity in the future, updating user access policy and identification
    55  policy, etc.
    66
    77Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    8 This program and the accompanying materials 
    9 are licensed and made available under the terms and conditions of the BSD License 
    10 which accompanies this distribution.  The full text of the license may be found at 
     8This program and the accompanying materials
     9are licensed and made available under the terms and conditions of the BSD License
     10which accompanies this distribution.  The full text of the license may be found at
    1111http://opensource.org/licenses/bsd-license.php
    1212
    13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     13THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1414WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1515
     
    7171
    7272/**
    73   This function gets all the credential providers in the system and saved them 
     73  This function gets all the credential providers in the system and saved them
    7474  to mProviderInfo.
    7575
    7676  @retval EFI_SUCESS     Init credential provider database successfully.
    7777  @retval Others         Fail to init credential provider database.
    78  
     78
    7979**/
    8080EFI_STATUS
     
    8686  UINTN       HandleCount;
    8787  EFI_HANDLE  *HandleBuf;
    88   UINTN       Index; 
    89  
     88  UINTN       Index;
     89
    9090  //
    9191  // Try to find all the user credential provider driver.
     
    103103    return Status;
    104104  }
    105  
     105
    106106  //
    107107  // Get provider infomation.
     
    111111  }
    112112  mProviderInfo = AllocateZeroPool (
    113                     sizeof (CREDENTIAL_PROVIDER_INFO) - 
     113                    sizeof (CREDENTIAL_PROVIDER_INFO) -
    114114                    sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) +
    115115                    HandleCount * sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *)
     
    192192        return EFI_SUCCESS;
    193193      }
    194  
     194
    195195      //
    196196      // Get current user
     
    202202        return EFI_NOT_READY;
    203203      }
    204      
     204
    205205      //
    206206      // Get current user's right information.
     
    210210        CurrentAccessRight = EFI_USER_INFO_ACCESS_ENROLL_SELF;
    211211      }
    212  
     212
    213213      //
    214214      // Init credential provider information.
     
    218218        return Status;
    219219      }
    220      
     220
    221221      //
    222222      // Initialize the container for dynamic opcodes.
     
    224224      StartOpCodeHandle = HiiAllocateOpCodeHandle ();
    225225      ASSERT (StartOpCodeHandle != NULL);
    226  
     226
    227227      EndOpCodeHandle = HiiAllocateOpCodeHandle ();
    228228      ASSERT (EndOpCodeHandle != NULL);
    229  
     229
    230230      //
    231231      // Create Hii Extend Label OpCode.
     
    239239      StartLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;
    240240      StartLabel->Number        = LABEL_USER_MANAGE_FUNC;
    241  
     241
    242242      EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (
    243243                                          EndOpCodeHandle,
     
    248248      EndLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;
    249249      EndLabel->Number        = LABEL_END;
    250  
     250
    251251      //
    252252      // Add user profile option.
     
    264264          );
    265265      }
    266      
     266
    267267      //
    268268      // Add modify user profile option.
     
    276276        KEY_MODIFY_USER                       // Question ID
    277277        );
    278  
     278
    279279      //
    280280      // Add delete user profile option
     
    290290          );
    291291      }
    292  
     292
    293293      HiiUpdateForm (
    294294        mCallbackInfo->HiiHandle,               // HII handle
     
    298298        EndOpCodeHandle                         // Replace data
    299299        );
    300  
     300
    301301      HiiFreeOpCodeHandle (StartOpCodeHandle);
    302302      HiiFreeOpCodeHandle (EndOpCodeHandle);
    303  
     303
    304304      return EFI_SUCCESS;
    305305    }
     
    311311
    312312  case EFI_BROWSER_ACTION_CHANGED:
    313   { 
     313  {
    314314    //
    315315    // Handle the request from form.
     
    318318      return EFI_INVALID_PARAMETER;
    319319    }
    320    
     320
    321321    //
    322322    // Judge first 2 bits.
     
    392392          // Change credential provider option.
    393393          //
    394           case KEY_MODIFY_PROV:         
     394          case KEY_MODIFY_PROV:
    395395            mProviderChoice = Value->u8;
    396396            break;
     
    556556
    557557  case EFI_BROWSER_ACTION_CHANGING:
    558   { 
     558  {
    559559    //
    560560    // Handle the request from form.
     
    563563      return EFI_INVALID_PARAMETER;
    564564    }
    565    
     565
    566566    //
    567567    // Judge first 2 bits.
     
    666666              DisplayLoadPermit ();
    667667              break;
    668          
     668
    669669            //
    670670            // Forbid load device path.
     
    673673              DisplayLoadForbid ();
    674674              break;
    675          
     675
    676676            default:
    677677              break;
    678678            }
    679679            break;
    680            
     680
    681681          //
    682682          // Connect device path form.
     
    693693              DisplayConnectPermit ();
    694694              break;
    695          
     695
    696696            //
    697697            // Forbid connect device path.
     
    700700              DisplayConnectForbid ();
    701701              break;
    702          
     702
    703703            default:
    704704              break;
     
    837837    return EFI_SUCCESS;
    838838  }
    839  
     839
    840840  //
    841841  // Initialize driver private data.
     
    845845
    846846  CallbackInfo = AllocateZeroPool (sizeof (USER_PROFILE_MANAGER_CALLBACK_INFO));
    847   ASSERT (CallbackInfo != NULL); 
     847  ASSERT (CallbackInfo != NULL);
    848848
    849849  CallbackInfo->Signature                   = USER_PROFILE_MANAGER_SIGNATURE;
     
    852852  CallbackInfo->ConfigAccess.Callback       = UserProfileManagerCallback;
    853853  CallbackInfo->DriverHandle                = NULL;
    854  
     854
    855855  //
    856856  // Install Device Path Protocol and Config Access protocol to driver handle.
     
    876876                              NULL
    877877                              );
    878   ASSERT (CallbackInfo->HiiHandle != NULL);                             
     878  ASSERT (CallbackInfo->HiiHandle != NULL);
    879879  mCallbackInfo = CallbackInfo;
    880880
     
    882882}
    883883
    884  
     884
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.h

    r58459 r58466  
    11/** @file
    22  The header file for user profile manager driver.
    3    
     3
    44Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    5656  UINTN     AccessPolicyLen;
    5757  UINTN     IdentityPolicyLen;
    58   UINTN     NewIdentityPolicyLen;   
     58  UINTN     NewIdentityPolicyLen;
    5959  UINT8     *AccessPolicy;
    6060  UINT8     *IdentityPolicy;
     
    198198  Add a username item in form.
    199199
    200   @param[in]  User             Points to the user profile whose username is added. 
     200  @param[in]  User             Points to the user profile whose username is added.
    201201  @param[in]  Index            The index of the user in the user name list.
    202202  @param[in]  OpCodeHandle     Points to container for dynamic created opcodes.
     
    217217
    218218  @param[in] UserIndex       The index of the user in display list to modify.
    219  
     219
    220220**/
    221221VOID
     
    225225
    226226/**
    227   Get the username from user input and update username string in Hii 
     227  Get the username from user input and update username string in Hii
    228228  database with it.
    229229
     
    254254/**
    255255  Save the identity policy and update UI with it.
    256  
    257   This funciton will verify the new identity policy, in current implementation, 
     256
     257  This funciton will verify the new identity policy, in current implementation,
    258258  the identity policy can be:  T, P & P & P & ..., P | P | P | ...
    259259  Here, "T" means "True", "P" means "Credential Provider", "&" means "and", "|" means "or".
    260   Other identity policies are not supported. 
     260  Other identity policies are not supported.
    261261
    262262**/
     
    271271  In this form, access right, access setu,p and access boot order are dynamically
    272272  added. Load devicepath and connect devicepath are displayed too.
    273  
     273
    274274**/
    275275VOID
     
    279279
    280280/**
    281   Collect all the access policy data to mUserInfo.AccessPolicy, 
     281  Collect all the access policy data to mUserInfo.AccessPolicy,
    282282  and save it to user profile.
    283283
     
    339339
    340340/**
    341   Delete the specified device path by DriverIndex from the forbid device path 
     341  Delete the specified device path by DriverIndex from the forbid device path
    342342  list (mAccessInfo.LoadForbid).
    343343
    344344  @param[in]  DriverIndex   The index of driver in a forbidden device path list.
    345  
     345
    346346**/
    347347VOID
     
    349349  IN  UINT16                                    DriverIndex
    350350  );
    351  
    352 /**
    353   Add the specified device path by DriverIndex to the forbid device path 
     351
     352/**
     353  Add the specified device path by DriverIndex to the forbid device path
    354354  list (mAccessInfo.LoadForbid).
    355355
    356356  @param[in]  DriverIndex   The index of driver saved in driver options.
    357  
     357
    358358**/
    359359VOID
     
    364364/**
    365365  Get user name from the popup windows.
    366  
     366
    367367  @param[in, out]  UserNameLen   On entry, point to the buffer lengh of UserName.
    368368                                 On exit, point to the input user name length.
    369369  @param[out]      UserName      The buffer to hold the input user name.
    370  
     370
    371371  @retval EFI_ABORTED            It is given up by pressing 'ESC' key.
    372372  @retval EFI_NOT_READY          Not a valid input at all.
     
    386386  @param[in]  InfoType     The user information type to find.
    387387  @param[out] UserInfo     Points to user information handle found.
    388  
     388
    389389  @retval EFI_SUCCESS      Find the user information successfully.
    390390  @retval Others           Fail to find the user information.
     
    419419  @param[in] ValidLen       The valid access policy length.
    420420  @param[in] ExpandLen      The length that is needed to expand.
    421    
     421
    422422**/
    423423VOID
     
    429429/**
    430430  Delete User's credental from all the providers that exist in User's identity policy.
    431  
     431
    432432  @param[in]  IdentityPolicy     Point to User's identity policy.
    433433  @param[in]  IdentityPolicyLen  The length of the identity policy.
     
    439439  IN     UINT8                                *IdentityPolicy,
    440440  IN     UINTN                                 IdentityPolicyLen,
    441   IN     EFI_USER_PROFILE_HANDLE               User 
    442   );
    443  
     441  IN     EFI_USER_PROFILE_HANDLE               User
     442  );
     443
    444444#endif
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerData.h

    r48674 r58466  
    11/** @file
    22  The form data for user profile manager driver.
    3    
     3
    44Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    4848
    4949//
    50 // First form key (Add/modify/del user profile). 
     50// First form key (Add/modify/del user profile).
    5151// First 2 bits (bit 16~15).
    5252//
     
    7878// Specified key, used in VFR (KEY_MODIFY_USER | KEY_SELECT_USER | KEY_MODIFY_NAME).
    7979//
    80 #define  KEY_MODIFY_USER_NAME       0x5200 
     80#define  KEY_MODIFY_USER_NAME       0x5200
    8181
    8282//
     
    135135// Device path modify key.
    136136// 2 bits (bit 12~11).
    137 // 
     137//
    138138#define KEY_LOAD_PERMIT_MODIFY      0x0000
    139139#define KEY_LOAD_FORBID_MODIFY      0x0400
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerDxe.inf

    r58459 r58466  
    5151  UefiLib
    5252  DevicePathLib
    53  
     53
    5454[Guids]
    5555  gEfiIfrTianoGuid                              ## SOMETIMES_CONSUMES  ## GUID
     
    6767[Depex]
    6868  gEfiUserManagerProtocolGuid
    69  
     69
    7070[UserExtensions.TianoCore."ExtraFiles"]
    7171  UserProfileManagerExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerStrings.uni

    • Property svn:mime-type changed from application/octet-stream to text/plain;encoding=UTF-16LE
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerVfr.Vfr

    • Property svn:eol-style set to native
    r58459 r58466  
    33
    44Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    1818#define USER_MANAGER_SUBCLASS    0x04
    1919
    20 formset 
     20formset
    2121  guid     = USER_PROFILE_MANAGER_GUID,
    22   title    = STRING_TOKEN(STR_FORMSET_TITLE), 
     22  title    = STRING_TOKEN(STR_FORMSET_TITLE),
    2323  help     = STRING_TOKEN(STR_TITLE_HELP),
    2424  class    = USER_MANAGER_CLASS,
    2525  subclass = USER_MANAGER_SUBCLASS,
    26    
     26
    2727  // User manager form
    2828  form formid = FORMID_USER_MANAGE,
     
    3939        key    = QUESTIONID_USER_MANAGE;
    4040    endif;
    41      
    42   endform;
    43  
     41
     42  endform;
     43
    4444  // Modify user profile form
    4545  form formid = FORMID_MODIFY_USER,
     
    5050
    5151  endform;
    52  
     52
    5353  // Delete user profile form
    5454  form formid = FORMID_DEL_USER,
    5555    title     = STRING_TOKEN(STR_DELETE_USER_TITLE);
    56  
     56
    5757    label LABEL_USER_DEL_FUNC;
    5858    label LABEL_END;
    59    
    60     subtitle 
    61       text   = STRING_TOKEN(STR_NULL_STRING);
    62   endform;
    63  
     59
     60    subtitle
     61      text   = STRING_TOKEN(STR_NULL_STRING);
     62  endform;
     63
    6464  //
    6565  // User profile information form
     
    6868    title     = STRING_TOKEN(STR_USER_INFO);
    6969
    70     text 
    71       help   = STRING_TOKEN(STR_USER_NAME_VAL), 
     70    text
     71      help   = STRING_TOKEN(STR_USER_NAME_VAL),
    7272      text   = STRING_TOKEN(STR_USER_NAME),
    7373      flags  = INTERACTIVE,
    7474      key    = KEY_MODIFY_USER_NAME;
    75      
    76     text 
    77       help   = STRING_TOKEN(STR_CREATE_DATE_VAL), 
     75
     76    text
     77      help   = STRING_TOKEN(STR_CREATE_DATE_VAL),
    7878      text   = STRING_TOKEN(STR_CREATE_DATE);
    79      
    80     text 
    81       help   = STRING_TOKEN(STR_USAGE_DATE_VAL), 
     79
     80    text
     81      help   = STRING_TOKEN(STR_USAGE_DATE_VAL),
    8282      text   = STRING_TOKEN(STR_USAGE_DATE);
    83      
    84     text 
    85       help   = STRING_TOKEN(STR_USAGE_COUNT_VAL), 
     83
     84    text
     85      help   = STRING_TOKEN(STR_USAGE_COUNT_VAL),
    8686      text   = STRING_TOKEN(STR_USAGE_COUNT);
    87      
    88     label LABEL_USER_INFO_FUNC; 
    89     label LABEL_END;
    90 
    91   endform;
    92  
     87
     88    label LABEL_USER_INFO_FUNC;
     89    label LABEL_END;
     90
     91  endform;
     92
    9393  //
    9494  // Identify policy modify form
     
    9797    title     = STRING_TOKEN(STR_IDENTIFY_POLICY);
    9898
    99     text 
     99    text
    100100      help   = STRING_TOKEN(STR_IDENTIFY_POLICY_HELP),
    101101      text   = STRING_TOKEN(STR_IDENTIFY_POLICY),
    102102        text   = STRING_TOKEN(STR_IDENTIFY_POLICY_VALUE);
    103      
     103
    104104    label LABEL_IP_MOD_FUNC;
    105105    label LABEL_END;
    106    
    107     text 
    108       help   = STRING_TOKEN(STR_ADD_OPTION_HELP), 
     106
     107    text
     108      help   = STRING_TOKEN(STR_ADD_OPTION_HELP),
    109109      text   = STRING_TOKEN(STR_ADD_OPTION),
    110110      flags  = INTERACTIVE,
    111111      key    = KEY_ADD_LOGICAL_OP;
    112      
    113     subtitle 
     112
     113    subtitle
    114114      text   = STRING_TOKEN(STR_NULL_STRING);
    115115
     
    121121
    122122  endform;
    123  
     123
    124124  //
    125125  // Access policy modify form
     
    143143      key     = KEY_CONN_DP;
    144144
    145     subtitle 
    146       text   = STRING_TOKEN(STR_NULL_STRING);
    147    
     145    subtitle
     146      text   = STRING_TOKEN(STR_NULL_STRING);
     147
    148148    text
    149149      help   = STRING_TOKEN(STR_ACCESS_SAVE_HELP),
     
    165165      flags   = INTERACTIVE,
    166166      key     = KEY_LOAD_PERMIT;
    167    
     167
    168168    goto FORMID_FORBID_LOAD_DP,
    169169      prompt  = STRING_TOKEN(STR_LOAD_FORBID),
     
    171171      flags   = INTERACTIVE,
    172172      key     = KEY_LOAD_FORBID;
    173  
    174   endform;
    175  
     173
     174  endform;
     175
    176176  //
    177177  // Permit load device path form
     
    179179  form formid = FORMID_PERMIT_LOAD_DP,
    180180    title     = STRING_TOKEN(STR_LOAD_PERMIT);
    181  
     181
    182182    label LABEL_PERMIT_LOAD_FUNC;
    183183    label LABEL_END;
    184  
    185     subtitle 
    186       text   = STRING_TOKEN(STR_NULL_STRING);
    187 
    188   endform;
    189  
     184
     185    subtitle
     186      text   = STRING_TOKEN(STR_NULL_STRING);
     187
     188  endform;
     189
    190190  //
    191191  // Forbid load device path form
     
    193193  form formid = FORMID_FORBID_LOAD_DP,
    194194    title     = STRING_TOKEN(STR_LOAD_FORBID);
    195  
     195
    196196    label LABLE_FORBID_LOAD_FUNC;
    197197    label LABEL_END;
    198    
    199     subtitle 
    200       text   = STRING_TOKEN(STR_NULL_STRING);
    201 
    202   endform;
    203  
     198
     199    subtitle
     200      text   = STRING_TOKEN(STR_NULL_STRING);
     201
     202  endform;
     203
    204204  //
    205205  // Connect device path form
     
    213213      flags   = INTERACTIVE,
    214214      key     = KEY_CONNECT_PERMIT;
    215      
     215
    216216    goto FORMID_FORBID_CONNECT_DP,
    217217      prompt  = STRING_TOKEN(STR_CONNECT_FORBID),
     
    219219      flags   = INTERACTIVE,
    220220      key     = KEY_CONNECT_FORBID;
    221      
    222   endform;
    223  
     221
     222  endform;
     223
    224224  //
    225225  // Permit connect device path form
     
    227227  form formid = FORMID_PERMIT_CONNECT_DP,
    228228    title     = STRING_TOKEN(STR_CONNECT_PERMIT);
    229      
    230     subtitle 
    231       text   = STRING_TOKEN(STR_NULL_STRING);
    232 
    233   endform;
    234  
     229
     230    subtitle
     231      text   = STRING_TOKEN(STR_NULL_STRING);
     232
     233  endform;
     234
    235235  //
    236236  // Forbid connect device path form
     
    238238  form formid = FORMID_FORBID_CONNECT_DP,
    239239    title     = STRING_TOKEN(STR_CONNECT_FORBID);
    240      
    241    subtitle 
     240
     241   subtitle
    242242     text   = STRING_TOKEN(STR_NULL_STRING);
    243243
    244244  endform;
    245  
     245
    246246endformset;
  • trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileModify.c

    r48674 r58466  
    11/** @file
    22  The functions to modify a user profile.
    3    
     3
    44Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials 
    6 are licensed and made available under the terms and conditions of the BSD License 
    7 which accompanies this distribution.  The full text of the license may be found at 
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
    88http://opensource.org/licenses/bsd-license.php
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
     
    128128  mUserInfo.UsageDateExist          = FALSE;
    129129  mUserInfo.UsageCount              = 0;
    130  
     130
    131131  mUserInfo.AccessPolicyLen         = 0;
    132132  mUserInfo.AccessPolicyModified    = FALSE;
     
    141141    mUserInfo.IdentityPolicy = NULL;
    142142  }
    143  
     143
    144144  //
    145145  // Allocate user information memory.
     
    150150    return ;
    151151  }
    152  
     152
    153153  //
    154154  // Get each user information.
     
    165165    InfoSize  = MemSize;
    166166    Status    = mUserManager->GetInfo (
    167                                 mUserManager, 
    168                                 mModifyUser, 
    169                                 UserInfo, 
    170                                 Info, 
     167                                mUserManager,
     168                                mModifyUser,
     169                                UserInfo,
     170                                Info,
    171171                                &InfoSize
    172172                                );
     
    282282    Str + StrLen (Str),
    283283    DateBufLen,
    284     L"%2d:%2d:%2d", 
     284    L"%2d:%2d:%2d",
    285285    Date->Hour,
    286286    Date->Minute,
    287287    Date->Second
    288288    );
    289  
     289
    290290  HiiSetString (mCallbackInfo->HiiHandle, DateId, Str, NULL);
    291291  FreePool (Str);
     
    309309  CHAR16  Count[10];
    310310
    311   UnicodeSPrint (Count, 20, L"%d", CountVal); 
     311  UnicodeSPrint (Count, 20, L"%d", CountVal);
    312312  HiiSetString (mCallbackInfo->HiiHandle, CountId, Count, NULL);
    313313}
     
    319319
    320320  @param[in, out]  Source1      On entry, point to a Null-terminated Unicode string.
    321                                 On exit, point to a new concatenated Unicode string                               
     321                                On exit, point to a new concatenated Unicode string
    322322  @param[in]       Source2      Pointer to a Null-terminated Unicode string.
    323323
     
    381381  EFI_HII_HANDLE                HiiHandle;
    382382  EFI_USER_CREDENTIAL2_PROTOCOL *UserCredential;
    383  
     383
    384384  TmpStr = NULL;
    385  
     385
    386386  //
    387387  // Resolve each policy.
     
    414414      for (Index = 0; Index < mProviderInfo->Count; Index++) {
    415415        UserCredential = mProviderInfo->Provider[Index];
    416         if (CompareGuid ((EFI_GUID *) (Identity + 1), &UserCredential->Type)) {     
    417           UserCredential->Title (
    418                             UserCredential,
    419                             &HiiHandle,
    420                             &ProvId
    421                             );
    422           ProvStr = HiiGetString (HiiHandle, ProvId, NULL);
    423           if (ProvStr != NULL) {
    424             AddStr (&TmpStr, ProvStr);
    425             FreePool (ProvStr);
    426           }
    427           break;
    428         }
    429       }
    430       break;
    431 
    432     case EFI_USER_INFO_IDENTITY_CREDENTIAL_PROVIDER:
    433       for (Index = 0; Index < mProviderInfo->Count; Index++) {
    434         UserCredential = mProviderInfo->Provider[Index];
    435         if (CompareGuid ((EFI_GUID *) (Identity + 1), &UserCredential->Identifier)) {         
     416        if (CompareGuid ((EFI_GUID *) (Identity + 1), &UserCredential->Type)) {
    436417          UserCredential->Title (
    437418                            UserCredential,
     
    448429      }
    449430      break;
     431
     432    case EFI_USER_INFO_IDENTITY_CREDENTIAL_PROVIDER:
     433      for (Index = 0; Index < mProviderInfo->Count; Index++) {
     434        UserCredential = mProviderInfo->Provider[Index];
     435        if (CompareGuid ((EFI_GUID *) (Identity + 1), &UserCredential->Identifier)) {
     436          UserCredential->Title (
     437                            UserCredential,
     438                            &HiiHandle,
     439                            &ProvId
     440                            );
     441          ProvStr = HiiGetString (HiiHandle, ProvId, NULL);
     442          if (ProvStr != NULL) {
     443            AddStr (&TmpStr, ProvStr);
     444            FreePool (ProvStr);
     445          }
     446          break;
     447        }
     448      }
     449      break;
    450450    }
    451451
     
    467467
    468468  @param[in] UserIndex       The index of the user in display list to modify.
    469  
     469
    470470**/
    471471VOID
     
    528528    UserIndex--;
    529529  }
    530  
     530
    531531  //
    532532  // Get user profile information.
     
    542542    NULL
    543543    );
    544  
     544
    545545  //
    546546  // Update create date.
     
    556556      );
    557557  }
    558  
     558
    559559  //
    560560  // Add usage date.
     
    570570      );
    571571  }
    572  
     572
    573573  //
    574574  // Add usage count.
    575575  //
    576576  ResolveCount ((UINT32) mUserInfo.UsageCount, STRING_TOKEN (STR_USAGE_COUNT_VAL));
    577  
     577
    578578  //
    579579  // Add identity policy.
     
    595595      );
    596596  }
    597  
     597
    598598  //
    599599  // Add access policy.
     
    644644
    645645  //
    646   // Set default value 
     646  // Set default value
    647647  //
    648648  mAccessInfo.AccessRight       = EFI_USER_INFO_ACCESS_ENROLL_SELF;
     
    654654  mAccessInfo.ConnectPermitLen  = 0;
    655655  mAccessInfo.ConnectForbidLen  = 0;
    656  
     656
    657657  //
    658658  // Get each user access policy.
     
    660660  OffSet = 0;
    661661  while (OffSet < mUserInfo.AccessPolicyLen) {
    662     CopyMem (&Control, mUserInfo.AccessPolicy + OffSet, sizeof (Control));   
     662    CopyMem (&Control, mUserInfo.AccessPolicy + OffSet, sizeof (Control));
    663663    ValLen = Control.Size - sizeof (Control);
    664664    switch (Control.Type) {
     
    755755  @param[in]  InfoType     The user information type to find.
    756756  @param[out] UserInfo     Points to user information handle found.
    757  
     757
    758758  @retval EFI_SUCCESS      Find the user information successfully.
    759759  @retval Others           Fail to find the user information.
     
    785785    return EFI_OUT_OF_RESOURCES;
    786786  }
    787  
     787
    788788  //
    789789  // Get each user information.
     
    837837  In this form, access right, access setup and access boot order are dynamically
    838838  added. Load devicepath and connect devicepath are displayed too.
    839  
     839
    840840**/
    841841VOID
     
    850850  EFI_IFR_GUID_LABEL  *EndLabel;
    851851  VOID                *DefaultOpCodeHandle;
    852  
     852
    853853  //
    854854  // Initialize the container for dynamic opcodes.
     
    894894  DefaultOpCodeHandle = HiiAllocateOpCodeHandle ();
    895895  ASSERT (DefaultOpCodeHandle != NULL);
    896  
     896
    897897  HiiCreateOneOfOptionOpCode (
    898898    OptionsOpCodeHandle,
     
    920920
    921921  HiiCreateDefaultOpCode (
    922     DefaultOpCodeHandle, 
    923     EFI_HII_DEFAULT_CLASS_STANDARD, 
    924     EFI_IFR_NUMERIC_SIZE_1, 
     922    DefaultOpCodeHandle,
     923    EFI_HII_DEFAULT_CLASS_STANDARD,
     924    EFI_IFR_NUMERIC_SIZE_1,
    925925    mAccessInfo.AccessRight
    926926    );
    927  
     927
    928928  HiiCreateOneOfOpCode (
    929929    StartOpCodeHandle,                    // Container for dynamic created opcodes
     
    949949  DefaultOpCodeHandle = HiiAllocateOpCodeHandle ();
    950950  ASSERT (DefaultOpCodeHandle != NULL);
    951  
     951
    952952  HiiCreateOneOfOptionOpCode (
    953953    OptionsOpCodeHandle,
     
    957957    ACCESS_SETUP_RESTRICTED
    958958    );
    959    
     959
    960960  HiiCreateOneOfOptionOpCode (
    961961    OptionsOpCodeHandle,
     
    975975
    976976  HiiCreateDefaultOpCode (
    977     DefaultOpCodeHandle, 
    978     EFI_HII_DEFAULT_CLASS_STANDARD, 
    979     EFI_IFR_NUMERIC_SIZE_1, 
     977    DefaultOpCodeHandle,
     978    EFI_HII_DEFAULT_CLASS_STANDARD,
     979    EFI_IFR_NUMERIC_SIZE_1,
    980980    mAccessInfo.AccessSetup
    981     );   
     981    );
    982982
    983983  HiiCreateOneOfOpCode (
     
    995995  HiiFreeOpCodeHandle (DefaultOpCodeHandle);
    996996  HiiFreeOpCodeHandle (OptionsOpCodeHandle);
    997  
     997
    998998  //
    999999  // Add boot order one-of-code.
     
    10031003  DefaultOpCodeHandle = HiiAllocateOpCodeHandle ();
    10041004  ASSERT (DefaultOpCodeHandle != NULL);
    1005  
     1005
    10061006  HiiCreateOneOfOptionOpCode (
    10071007    OptionsOpCodeHandle,
     
    10271027    EFI_USER_INFO_ACCESS_BOOT_ORDER_REPLACE
    10281028    );
    1029    
     1029
    10301030  HiiCreateOneOfOptionOpCode (
    10311031    OptionsOpCodeHandle,
     
    10371037
    10381038  HiiCreateDefaultOpCode (
    1039     DefaultOpCodeHandle, 
    1040     EFI_HII_DEFAULT_CLASS_STANDARD, 
    1041     EFI_IFR_NUMERIC_SIZE_4, 
     1039    DefaultOpCodeHandle,
     1040    EFI_HII_DEFAULT_CLASS_STANDARD,
     1041    EFI_IFR_NUMERIC_SIZE_4,
    10421042    mAccessInfo.AccessBootOrder
    10431043    );
    1044    
     1044
    10451045  HiiCreateOneOfOpCode (
    10461046    StartOpCodeHandle,                  // Container for dynamic created opcodes
     
    10551055    DefaultOpCodeHandle                 // Default Opcode
    10561056    );
    1057   HiiFreeOpCodeHandle (DefaultOpCodeHandle);   
     1057  HiiFreeOpCodeHandle (DefaultOpCodeHandle);
    10581058  HiiFreeOpCodeHandle (OptionsOpCodeHandle);
    10591059
     
    10791079  @param[in] ValidLen       The valid access policy length.
    10801080  @param[in] ExpandLen      The length that is needed to expand.
    1081    
     1081
    10821082**/
    10831083VOID
     
    11081108
    11091109/**
    1110   Get the username from user input, and update username string in the Hii 
     1110  Get the username from user input, and update username string in the Hii
    11111111  database with it.
    11121112
     
    11431143    return ;
    11441144  }
    1145  
     1145
    11461146  //
    11471147  // Check whether the username had been used or not.
     
    11791179    return ;
    11801180  }
    1181  
     1181
    11821182  //
    11831183  // Update username display in the form.
     
    11851185  CopyMem (mUserInfo.UserName, UserName, Len);
    11861186  HiiSetString (
    1187     mCallbackInfo->HiiHandle, 
    1188     STRING_TOKEN (STR_USER_NAME_VAL), 
    1189     mUserInfo.UserName, 
     1187    mCallbackInfo->HiiHandle,
     1188    STRING_TOKEN (STR_USER_NAME_VAL),
     1189    mUserInfo.UserName,
    11901190    NULL
    11911191    );
     
    13041304    HiiFreeOpCodeHandle (OptionsOpCodeHandle);
    13051305  }
    1306  
     1306
    13071307  //
    13081308  // Add logical connector Option OpCode.
     
    13461346  //
    13471347  ResolveIdentityPolicy (
    1348     mUserInfo.IdentityPolicy, 
    1349     mUserInfo.IdentityPolicyLen, 
     1348    mUserInfo.IdentityPolicy,
     1349    mUserInfo.IdentityPolicyLen,
    13501350    STRING_TOKEN (STR_IDENTIFY_POLICY_VALUE)
    13511351    );
     
    14051405    return EFI_OUT_OF_RESOURCES;
    14061406  }
    1407  
     1407
    14081408  //
    14091409  // Get user access information.
     
    14461446      break;
    14471447    }
    1448    
     1448
    14491449    //
    14501450    // Check user information.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette