Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProvider.c
r58459 r58466 1 1 /** @file 2 2 Password Credential Provider driver implementation. 3 3 4 4 Copyright (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 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 98 98 // 99 99 NewTable = (CREDENTIAL_TABLE *) AllocateZeroPool ( 100 sizeof (CREDENTIAL_TABLE) + 100 sizeof (CREDENTIAL_TABLE) + 101 101 (Count - 1) * sizeof (PASSWORD_INFO) 102 102 ); 103 ASSERT (NewTable != NULL); 103 ASSERT (NewTable != NULL); 104 104 105 105 NewTable->MaxCount = Count; … … 110 110 // 111 111 CopyMem ( 112 &NewTable->UserInfo, 113 &mPwdTable->UserInfo, 112 &NewTable->UserInfo, 113 &mPwdTable->UserInfo, 114 114 mPwdTable->Count * sizeof (PASSWORD_INFO) 115 115 ); … … 123 123 124 124 @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, 127 127 delete the info by Index. 128 128 … … 151 151 if (Index != mPwdTable->Count) { 152 152 NewPasswordInfo = &mPwdTable->UserInfo[mPwdTable->Count]; 153 } 153 } 154 154 } else { 155 155 // … … 214 214 Var = NULL; 215 215 Status = gRT->GetVariable ( 216 L"PwdCredential", 217 &gPwdCredentialProviderGuid, 218 NULL, 216 L"PwdCredential", 217 &gPwdCredentialProviderGuid, 218 NULL, 219 219 &VarSize, 220 220 Var … … 226 226 } 227 227 Status = gRT->GetVariable ( 228 L"PwdCredential", 229 &gPwdCredentialProviderGuid, 230 NULL, 228 L"PwdCredential", 229 &gPwdCredentialProviderGuid, 230 NULL, 231 231 &VarSize, 232 232 Var … … 236 236 return Status; 237 237 } 238 238 239 239 // 240 240 // Create the password credential table. … … 242 242 mPwdTable = AllocateZeroPool ( 243 243 sizeof (CREDENTIAL_TABLE) - sizeof (PASSWORD_INFO) + 244 PASSWORD_TABLE_INC * sizeof (PASSWORD_INFO) + 244 PASSWORD_TABLE_INC * sizeof (PASSWORD_INFO) + 245 245 VarSize 246 246 ); … … 270 270 @retval TRUE Hash the password successfully. 271 271 @retval FALSE Failed to hash the password. 272 272 273 273 **/ 274 274 BOOLEAN … … 282 282 UINTN HashSize; 283 283 VOID *Hash; 284 284 285 285 HashSize = Sha1GetContextSize (); 286 286 Hash = AllocatePool (HashSize); 287 287 ASSERT (Hash != NULL); 288 288 289 289 Status = Sha1Init (Hash); 290 290 if (!Status) { 291 291 goto Done; 292 292 } 293 293 294 294 Status = Sha1Update (Hash, Password, PasswordSize); 295 295 if (!Status) { 296 296 goto Done; 297 297 } 298 298 299 299 Status = Sha1Final (Hash, Credential); 300 300 301 301 Done: 302 302 FreePool (Hash); … … 325 325 CHAR16 *QuestionStr; 326 326 CHAR16 *LineStr; 327 327 328 328 PasswordLen = 0; 329 329 while (TRUE) { … … 346 346 FreePool (QuestionStr); 347 347 FreePool (LineStr); 348 348 349 349 // 350 350 // Check key stroke … … 357 357 PasswordLen--; 358 358 } 359 } else if ((Key.UnicodeChar == CHAR_NULL) || 360 (Key.UnicodeChar == CHAR_TAB) || 359 } else if ((Key.UnicodeChar == CHAR_NULL) || 360 (Key.UnicodeChar == CHAR_TAB) || 361 361 (Key.UnicodeChar == CHAR_LINEFEED)) { 362 362 continue; … … 371 371 } 372 372 } 373 373 374 374 PasswordLen = PasswordLen * sizeof (CHAR16); 375 375 GenerateCredential (Password, PasswordLen, (UINT8 *)Credential); … … 392 392 UINTN Index; 393 393 CHAR8 *Pwd; 394 394 395 395 // 396 396 // Check password credential. … … 412 412 Find a user infomation record by the information record type. 413 413 414 This function searches all user information records of User from beginning 414 This function searches all user information records of User from beginning 415 415 until either the information is found, or there are no more user infomation 416 416 records. A match occurs when a Info.InfoType field matches the user information 417 417 record type. 418 418 419 @param[in] User Points to the user profile record to search. 419 @param[in] User Points to the user profile record to search. 420 420 @param[in] InfoType The infomation type to be searched. 421 421 @param[out] Info Points to the user info found, the caller is responsible 422 422 to free. 423 423 424 424 @retval EFI_SUCCESS Find the user information successfully. 425 425 @retval Others Fail to find the user information. … … 438 438 EFI_USER_INFO_HANDLE UserInfoHandle; 439 439 EFI_USER_MANAGER_PROTOCOL *UserManager; 440 440 441 441 // 442 442 // Find user information by information type. … … 501 501 *Info = UserInfo; 502 502 return EFI_SUCCESS; 503 } 503 } 504 504 } 505 505 … … 570 570 } 571 571 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; 572 } 572 } 573 573 return EFI_SUCCESS; 574 574 } … … 714 714 Enroll a user on a credential provider. 715 715 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; 718 718 otherwise add the user information on credential provider. 719 719 720 720 @param[in] This Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL. 721 721 @param[in] User The user profile to enroll. 722 722 723 723 @retval EFI_SUCCESS User profile was successfully enrolled. 724 724 @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the 725 725 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 727 727 other than the current user profile. 728 728 @retval EFI_UNSUPPORTED This credential provider does not support enrollment in … … 731 731 error. 732 732 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle. 733 733 734 734 **/ 735 735 EFI_STATUS … … 767 767 } 768 768 769 CopyMem (PwdInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER)); 769 CopyMem (PwdInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER)); 770 770 FreePool (UserInfo); 771 771 772 772 // 773 773 // Get password from user. 774 // 774 // 775 775 while (TRUE) { 776 776 // … … 789 789 if (CompareMem (PwdInfo.Password, Password, CREDENTIAL_LEN) == 0) { 790 790 break; 791 } 791 } 792 792 793 793 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)); 795 795 CreatePopUp ( 796 796 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, … … 807 807 // 808 808 // Check whether User is ever enrolled in the provider. 809 // 809 // 810 810 for (Index = 0; Index < mPwdTable->Count; Index++) { 811 811 UserId = (UINT8 *) &mPwdTable->UserInfo[Index].UserId; … … 813 813 // 814 814 // User already exists, update the password. 815 // 815 // 816 816 break; 817 817 } 818 818 } 819 819 820 820 // 821 821 // Enroll the User to the provider. … … 835 835 This function returns information about the form used when interacting with the 836 836 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 838 838 the user credential provider does not require a form to identify the user, then this 839 839 function should return EFI_NOT_FOUND. … … 843 843 @param[out] FormSetId On return, holds the identifier of the form set which contains 844 844 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 846 846 identification. 847 847 848 848 @retval EFI_SUCCESS Form returned successfully. 849 849 @retval EFI_NOT_FOUND Form not returned. 850 850 @retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL. 851 851 852 852 **/ 853 853 EFI_STATUS … … 860 860 ) 861 861 { 862 if ((This == NULL) || (Hii == NULL) || 862 if ((This == NULL) || (Hii == NULL) || 863 863 (FormSetId == NULL) || (FormId == NULL)) { 864 864 return EFI_INVALID_PARAMETER; … … 868 868 *FormId = FORMID_GET_PASSWORD_FORM; 869 869 CopyGuid (FormSetId, &gPwdCredentialProviderGuid); 870 870 871 871 return EFI_SUCCESS; 872 872 } … … 878 878 This optional function returns a bitmap that is less than or equal to the number 879 879 of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND 880 is returned. 880 is returned. 881 881 882 882 @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 885 885 width of the bitmap returned. 886 886 @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 888 888 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 892 892 @retval EFI_SUCCESS Image identifier returned successfully. 893 893 @retval EFI_NOT_FOUND Image identifier not returned. 894 894 @retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL. 895 895 896 896 **/ 897 897 EFI_STATUS … … 904 904 OUT EFI_IMAGE_ID *Image 905 905 ) 906 { 906 { 907 907 if ((This == NULL) || (Hii == NULL) || (Image == NULL)) { 908 908 return EFI_INVALID_PARAMETER; … … 916 916 917 917 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. 919 919 920 920 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 921 921 @param[out] Hii On return, holds the HII database handle. 922 922 @param[out] String On return, holds the HII string identifier. 923 923 924 924 @retval EFI_SUCCESS String identifier returned successfully. 925 925 @retval EFI_NOT_FOUND String identifier not returned. 926 926 @retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL. 927 927 928 928 **/ 929 929 EFI_STATUS … … 938 938 return EFI_INVALID_PARAMETER; 939 939 } 940 940 941 941 // 942 942 // Set Hii handle and String ID. … … 953 953 954 954 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 956 956 submitted on a form, OR after a call to Default() has returned that this credential is 957 957 ready to log on. 958 958 959 959 @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 961 961 considered by the user identity manager. If NULL, then no user 962 962 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 965 965 @retval EFI_SUCCESS User identifier returned successfully. 966 966 @retval EFI_NOT_READY No user identifier can be returned. … … 969 969 @retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be 970 970 found in user profile database 971 971 972 972 **/ 973 973 EFI_STATUS … … 998 998 return EFI_NOT_READY; 999 999 } 1000 1000 1001 1001 if (User == NULL) { 1002 1002 // 1003 1003 // Return the user ID whose password matches the input password. 1004 // 1004 // 1005 1005 CopyMem ( 1006 Identifier, 1007 &mPwdTable->UserInfo[mPwdTable->ValidIndex - 1].UserId, 1006 Identifier, 1007 &mPwdTable->UserInfo[mPwdTable->ValidIndex - 1].UserId, 1008 1008 sizeof (EFI_USER_INFO_IDENTIFIER) 1009 ); 1009 ); 1010 1010 return EFI_SUCCESS; 1011 1011 } 1012 1012 1013 1013 // 1014 1014 // Get the User's ID. … … 1022 1022 return EFI_NOT_FOUND; 1023 1023 } 1024 1024 1025 1025 // 1026 1026 // Check whether the input password matches one in PwdTable. … … 1036 1036 FreePool (UserInfo); 1037 1037 return EFI_SUCCESS; 1038 } 1039 } 1040 } 1041 1042 FreePool (UserInfo); 1038 } 1039 } 1040 } 1041 1042 FreePool (UserInfo); 1043 1043 return EFI_NOT_READY; 1044 1044 } … … 1048 1048 Indicate that user interface interaction has begun for the specified credential. 1049 1049 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 1051 1051 AutoLogon returns FALSE, then the user interface will be constructed by the User 1052 Identity Manager. 1052 Identity Manager. 1053 1053 1054 1054 @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 1058 1058 @retval EFI_SUCCESS Credential provider successfully selected. 1059 1059 @retval EFI_INVALID_PARAMETER AutoLogon is NULL. 1060 1060 1061 1061 **/ 1062 1062 EFI_STATUS … … 1082 1082 1083 1083 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 1084 1084 1085 1085 @retval EFI_SUCCESS Credential provider successfully deselected. 1086 1086 1087 1087 **/ 1088 1088 EFI_STATUS … … 1102 1102 Return the default logon behavior for this user credential. 1103 1103 1104 This function reports the default login behavior regarding this credential provider. 1104 This function reports the default login behavior regarding this credential provider. 1105 1105 1106 1106 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 1107 1107 @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 1110 1110 @retval EFI_SUCCESS Default information successfully returned. 1111 1111 @retval EFI_INVALID_PARAMETER AutoLogon is NULL. 1112 1112 1113 1113 **/ 1114 1114 EFI_STATUS … … 1123 1123 } 1124 1124 *AutoLogon = 0; 1125 1125 1126 1126 return EFI_SUCCESS; 1127 1127 } … … 1131 1131 Return information attached to the credential provider. 1132 1132 1133 This function returns user information. 1133 This function returns user information. 1134 1134 1135 1135 @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. 1137 1137 @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On 1138 1138 exit, holds the user information. If the buffer is too small … … 1140 1140 and InfoSize is updated to contain the number of bytes actually 1141 1141 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 1145 1145 @retval EFI_SUCCESS Information returned successfully. 1146 1146 @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the 1147 1147 user information. The size required is returned in *InfoSize. 1148 1148 @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 1151 1151 **/ 1152 1152 EFI_STATUS … … 1161 1161 EFI_USER_INFO *CredentialInfo; 1162 1162 UINTN Index; 1163 1163 1164 1164 if ((This == NULL) || (InfoSize == NULL) || (Info == NULL)) { 1165 1165 return EFI_INVALID_PARAMETER; … … 1169 1169 return EFI_NOT_FOUND; 1170 1170 } 1171 1171 1172 1172 // 1173 1173 // Find information handle in credential info table. … … 1183 1183 return EFI_BUFFER_TOO_SMALL; 1184 1184 } 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 1190 1190 return EFI_NOT_FOUND; 1191 1191 } … … 1198 1198 information record handle, point UserInfo at a NULL. Each subsequent call will retrieve 1199 1199 another user information record handle until there are no more, at which point UserInfo 1200 will point to NULL. 1200 will point to NULL. 1201 1201 1202 1202 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. … … 1204 1204 to start enumeration. On exit, points to the next user information 1205 1205 handle or NULL if there is no more user information. 1206 1206 1207 1207 @retval EFI_SUCCESS User information returned. 1208 1208 @retval EFI_NOT_FOUND No more user information found. 1209 1209 @retval EFI_INVALID_PARAMETER UserInfo is NULL. 1210 1210 1211 1211 **/ 1212 1212 EFI_STATUS … … 1222 1222 UINTN Index; 1223 1223 UINTN ProvStrLen; 1224 1224 1225 1225 if ((This == NULL) || (UserInfo == NULL)) { 1226 1226 return EFI_INVALID_PARAMETER; … … 1244 1244 Info = AllocateZeroPool (InfoLen); 1245 1245 ASSERT (Info != NULL); 1246 1246 1247 1247 Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_RECORD; 1248 1248 Info->InfoSize = (UINT32) InfoLen; … … 1250 1250 CopyGuid (&Info->Credential, &gPwdCredentialProviderGuid); 1251 1251 CopyGuid ((EFI_GUID *)(Info + 1), &gPwdCredentialProviderGuid); 1252 1252 1253 1253 mPwdInfoHandle->Info[0] = Info; 1254 1254 mPwdInfoHandle->Count++; … … 1262 1262 Info = AllocateZeroPool (InfoLen); 1263 1263 ASSERT (Info != NULL); 1264 1264 1265 1265 Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD; 1266 1266 Info->InfoSize = (UINT32) InfoLen; … … 1279 1279 Info = AllocateZeroPool (InfoLen); 1280 1280 ASSERT (Info != NULL); 1281 1281 1282 1282 Info->InfoType = EFI_USER_INFO_CREDENTIAL_TYPE_RECORD; 1283 1283 Info->InfoSize = (UINT32) InfoLen; … … 1285 1285 CopyGuid (&Info->Credential, &gPwdCredentialProviderGuid); 1286 1286 CopyGuid ((EFI_GUID *)(Info + 1), &gEfiUserCredentialClassPasswordGuid); 1287 1287 1288 1288 mPwdInfoHandle->Info[2] = Info; 1289 1289 mPwdInfoHandle->Count++; 1290 1290 1291 1291 // 1292 1292 // The fourth information, Credential Provider type name info. … … 1297 1297 Info = AllocateZeroPool (InfoLen); 1298 1298 ASSERT (Info != NULL); 1299 1299 1300 1300 Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD; 1301 1301 Info->InfoSize = (UINT32) InfoLen; … … 1304 1304 CopyMem ((UINT8*)(Info + 1), ProvNameStr, ProvStrLen); 1305 1305 FreePool (ProvNameStr); 1306 1306 1307 1307 mPwdInfoHandle->Info[3] = Info; 1308 1308 mPwdInfoHandle->Count++; 1309 1309 } 1310 1310 1311 1311 if (*UserInfo == NULL) { 1312 1312 // … … 1316 1316 return EFI_SUCCESS; 1317 1317 } 1318 1318 1319 1319 // 1320 1320 // Find information handle in credential info table. … … 1333 1333 return EFI_NOT_FOUND; 1334 1334 } 1335 1335 1336 1336 Index++; 1337 1337 *UserInfo = (EFI_USER_INFO_HANDLE)mPwdInfoHandle->Info[Index]; 1338 return EFI_SUCCESS; 1338 return EFI_SUCCESS; 1339 1339 } 1340 1340 } … … 1347 1347 Delete a user on this credential provider. 1348 1348 1349 This function deletes a user on this credential provider. 1349 This function deletes a user on this credential provider. 1350 1350 1351 1351 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. … … 1353 1353 1354 1354 @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. 1358 1358 @retval EFI_UNSUPPORTED This credential provider does not support deletion in the pre-OS. 1359 1359 @retval EFI_DEVICE_ERROR The new credential could not be deleted because of a device error. … … 1372 1372 UINT8 *NewUserId; 1373 1373 UINTN Index; 1374 1374 1375 1375 if ((This == NULL) || (User == NULL)) { 1376 1376 return EFI_INVALID_PARAMETER; … … 1392 1392 // 1393 1393 // Find the user by user identifier in mPwdTable. 1394 // 1394 // 1395 1395 for (Index = 0; Index < mPwdTable->Count; Index++) { 1396 1396 UserId = (UINT8 *) &mPwdTable->UserInfo[Index].UserId; … … 1440 1440 return Status; 1441 1441 } 1442 1442 1443 1443 // 1444 1444 // Init Form Browser. … … 1448 1448 return Status; 1449 1449 } 1450 1450 1451 1451 // 1452 1452 // Install protocol interfaces for the password credential provider. -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProvider.h
r48674 r58466 1 1 /** @file 2 2 Password Credential Provider driver header file. 3 3 4 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 93 93 Enroll a user on a credential provider. 94 94 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; 97 97 otherwise delete the user information on credential provider. 98 98 99 99 @param[in] This Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL. 100 100 @param[in] User The user profile to enroll. 101 101 102 102 @retval EFI_SUCCESS User profile was successfully enrolled. 103 103 @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the 104 104 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 106 106 other than the current user profile. 107 107 @retval EFI_UNSUPPORTED This credential provider does not support enrollment in … … 110 110 error. 111 111 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle. 112 112 113 113 **/ 114 114 EFI_STATUS … … 124 124 This function returns information about the form used when interacting with the 125 125 user during user identification. The form is the first enabled form in the form-set 126 class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If 126 class EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If 127 127 the user credential provider does not require a form to identify the user, then this 128 128 function should return EFI_NOT_FOUND. … … 132 132 @param[out] FormSetId On return, holds the identifier of the form set which contains 133 133 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 135 135 identification. 136 136 137 137 @retval EFI_SUCCESS Form returned successfully. 138 138 @retval EFI_NOT_FOUND Form not returned. 139 139 @retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL. 140 140 141 141 **/ 142 142 EFI_STATUS … … 154 154 This optional function returns a bitmap which is less than or equal to the number 155 155 of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND 156 is returned. 156 is returned. 157 157 158 158 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 159 @param[in, out] Width On entry, points to the desired bitmap width. If NULL then no 160 bitmap information will be returned. On exit, points to the 159 @param[in, out] Width On entry, points to the desired bitmap width. If NULL then no 160 bitmap information will be returned. On exit, points to the 161 161 width of the bitmap returned. 162 162 @param[in, out] Height On entry, points to the desired bitmap height. If NULL then no 163 bitmap information will be returned. On exit, points to the 163 bitmap information will be returned. On exit, points to the 164 164 height of the bitmap returned 165 @param[out] Hii On return, holds the HII database handle. 166 @param[out] Image On return, holds the HII image identifier. 167 165 @param[out] Hii On return, holds the HII database handle. 166 @param[out] Image On return, holds the HII image identifier. 167 168 168 @retval EFI_SUCCESS Image identifier returned successfully. 169 169 @retval EFI_NOT_FOUND Image identifier not returned. 170 170 @retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL. 171 171 172 172 **/ 173 173 EFI_STATUS … … 185 185 186 186 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. 188 188 189 189 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 190 190 @param[out] Hii On return, holds the HII database handle. 191 191 @param[out] String On return, holds the HII string identifier. 192 192 193 193 @retval EFI_SUCCESS String identifier returned successfully. 194 194 @retval EFI_NOT_FOUND String identifier not returned. 195 195 @retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL. 196 196 197 197 **/ 198 198 EFI_STATUS … … 208 208 209 209 This function returns the user identifier of the user authenticated by this credential 210 provider. This function is called after the credential-related information has been 210 provider. This function is called after the credential-related information has been 211 211 submitted on a form OR after a call to Default() has returned that this credential is 212 212 ready to log on. 213 213 214 214 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 215 @param[in] User The user profile handle of the user profile currently being 215 @param[in] User The user profile handle of the user profile currently being 216 216 considered by the user identity manager. If NULL, then no user 217 217 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 220 220 @retval EFI_SUCCESS User identifier returned successfully. 221 221 @retval EFI_NOT_READY No user identifier can be returned. … … 224 224 @retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be 225 225 found in user profile database 226 226 227 227 **/ 228 228 EFI_STATUS … … 237 237 Indicate that user interface interaction has begun for the specified credential. 238 238 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 240 240 AutoLogon returns FALSE, then the user interface will be constructed by the User 241 Identity Manager. 241 Identity Manager. 242 242 243 243 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 244 @param[out] AutoLogon On return, points to the credential provider's capabilities 245 after the credential provider has been selected by the user. 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 247 247 @retval EFI_SUCCESS Credential provider successfully selected. 248 248 @retval EFI_INVALID_PARAMETER AutoLogon is NULL. 249 249 250 250 **/ 251 251 EFI_STATUS … … 262 262 263 263 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 264 264 265 265 @retval EFI_SUCCESS Credential provider successfully deselected. 266 266 267 267 **/ 268 268 EFI_STATUS … … 275 275 Return the default logon behavior for this user credential. 276 276 277 This function reports the default login behavior regarding this credential provider. 277 This function reports the default login behavior regarding this credential provider. 278 278 279 279 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 280 280 @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 283 283 @retval EFI_SUCCESS Default information successfully returned. 284 284 @retval EFI_INVALID_PARAMETER AutoLogon is NULL. … … 295 295 Return information attached to the credential provider. 296 296 297 This function returns user information. 297 This function returns user information. 298 298 299 299 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 300 @param[in] UserInfo Handle of the user information data record. 300 @param[in] UserInfo Handle of the user information data record. 301 301 @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On 302 302 exit, holds the user information. If the buffer is too small … … 304 304 and InfoSize is updated to contain the number of bytes actually 305 305 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 309 309 @retval EFI_SUCCESS Information returned successfully. 310 310 @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the 311 311 user information. The size required is returned in *InfoSize. 312 312 @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL. 313 @retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle. 314 313 @retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle. 314 315 315 **/ 316 316 EFI_STATUS … … 330 330 information record handle, point UserInfo at a NULL. Each subsequent call will retrieve 331 331 another user information record handle until there are no more, at which point UserInfo 332 will point to NULL. 332 will point to NULL. 333 333 334 334 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. … … 336 336 to start enumeration. On exit, points to the next user information 337 337 handle or NULL if there is no more user information. 338 338 339 339 @retval EFI_SUCCESS User information returned. 340 340 @retval EFI_NOT_FOUND No more user information found. 341 341 @retval EFI_INVALID_PARAMETER UserInfo is NULL. 342 342 343 343 **/ 344 344 EFI_STATUS … … 352 352 Delete a user on this credential provider. 353 353 354 This function deletes a user on this credential provider. 354 This function deletes a user on this credential provider. 355 355 356 356 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. … … 358 358 359 359 @retval EFI_SUCCESS User profile was successfully deleted. 360 @retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle. 361 Either the user profile cannot delete on any user profile or cannot delete 362 on a user profile other than the current user profile. 360 @retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle. 361 Either the user profile cannot delete on any user profile or cannot delete 362 on a user profile other than the current user profile. 363 363 @retval EFI_UNSUPPORTED This credential provider does not support deletion in the pre-OS. 364 364 @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 1 1 /** @file 2 2 Data structure used by the Password Credential Provider driver. 3 3 4 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 25 25 // 26 26 // Key defination 27 // 27 // 28 28 #define KEY_GET_PASSWORD 0x1000 29 29 -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProviderDxe.inf
r58459 r58466 45 45 UefiLib 46 46 BaseCryptLib 47 47 48 48 [Guids] 49 49 gEfiUserCredentialClassPasswordGuid ## SOMETIMES_CONSUMES ## GUID 50 50 51 51 ## PRODUCES ## Variable:L"PwdCredential" 52 52 ## CONSUMES ## Variable:L"PwdCredential" … … 54 54 ## SOMETIMES_CONSUMES ## GUID # The credential provider identifier 55 55 gPwdCredentialProviderGuid 56 56 57 57 [Protocols] 58 58 gEfiDevicePathProtocolGuid ## PRODUCES … … 60 60 gEfiUserCredential2ProtocolGuid ## PRODUCES 61 61 gEfiUserManagerProtocolGuid ## SOMETIMES_CONSUMES 62 62 63 63 [UserExtensions.TianoCore."ExtraFiles"] 64 64 PwdCredentialProviderExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProviderStrings.uni
-
Property svn:mime-type
changed from
application/octet-stream
totext/plain;encoding=UTF-16LE
-
Property svn:mime-type
changed from
-
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProviderVfr.Vfr
-
Property svn:eol-style
set to
native
r58459 r58466 3 3 4 4 Copyright (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 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 15 15 #include "PwdCredentialProviderData.h" 16 16 17 formset 17 formset 18 18 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), 21 21 classguid = PWD_CREDENTIAL_PROVIDER_GUID, 22 23 form formid = FORMID_GET_PASSWORD_FORM, 22 23 form formid = FORMID_GET_PASSWORD_FORM, 24 24 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), 28 28 text = STRING_TOKEN(STR_INPUT_PASSWORD), 29 29 flags = INTERACTIVE, … … 31 31 32 32 endform; 33 33 34 34 endformset; -
Property svn:eol-style
set to
-
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProvider.c
r58459 r58466 1 1 /** @file 2 2 Usb Credential Provider driver implemenetation. 3 3 4 4 Copyright (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 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 79 79 Count * sizeof (USB_INFO) 80 80 ); 81 ASSERT (NewTable != NULL); 81 ASSERT (NewTable != NULL); 82 82 83 83 NewTable->MaxCount = Count; … … 88 88 // 89 89 CopyMem ( 90 &NewTable->UserInfo, 91 &mUsbTable->UserInfo, 90 &NewTable->UserInfo, 91 &mUsbTable->UserInfo, 92 92 mUsbTable->Count * sizeof (USB_INFO) 93 93 ); … … 101 101 102 102 @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, 105 105 delete the info by Index. 106 106 … … 118 118 EFI_STATUS Status; 119 119 USB_INFO *NewUsbInfo; 120 120 121 121 NewUsbInfo = NULL; 122 122 if (Index < mUsbTable->Count) { … … 128 128 if (Index != mUsbTable->Count) { 129 129 NewUsbInfo = &mUsbTable->UserInfo[mUsbTable->Count]; 130 } 130 } 131 131 } else { 132 132 // … … 191 191 Var = NULL; 192 192 Status = gRT->GetVariable ( 193 L"UsbCredential", 194 &gUsbCredentialProviderGuid, 195 NULL, 193 L"UsbCredential", 194 &gUsbCredentialProviderGuid, 195 NULL, 196 196 &VarSize, 197 197 Var … … 203 203 } 204 204 Status = gRT->GetVariable ( 205 L"UsbCredential", 206 &gUsbCredentialProviderGuid, 207 NULL, 205 L"UsbCredential", 206 &gUsbCredentialProviderGuid, 207 NULL, 208 208 &VarSize, 209 209 Var … … 213 213 return Status; 214 214 } 215 215 216 216 // 217 217 // Init Usb credential table. … … 219 219 mUsbTable = AllocateZeroPool ( 220 220 sizeof (CREDENTIAL_TABLE) - sizeof (USB_INFO) + 221 USB_TABLE_INC * sizeof (USB_INFO) + 221 USB_TABLE_INC * sizeof (USB_INFO) + 222 222 VarSize 223 223 ); … … 307 307 continue; 308 308 } 309 309 310 310 Status = SimpleFileSystem->OpenVolume ( 311 311 SimpleFileSystem, … … 315 315 continue; 316 316 } 317 317 318 318 Status = RootFs->Open ( 319 319 RootFs, … … 325 325 if (!EFI_ERROR (Status)) { 326 326 break; 327 } 327 } 328 328 } 329 329 } … … 336 336 goto Done; 337 337 } 338 338 339 339 // 340 340 // Figure out how big the file is. … … 353 353 } 354 354 355 FileInfo = AllocateZeroPool (ScratchBufferSize); 355 FileInfo = AllocateZeroPool (ScratchBufferSize); 356 356 if (FileInfo == NULL) { 357 357 DEBUG ((DEBUG_ERROR, "Can not allocate enough memory for the token file!\n")); … … 371 371 goto Done; 372 372 } 373 373 374 374 // 375 375 // Allocate a buffer for the file. 376 376 // 377 377 *BufferSize = (UINT32) FileInfo->FileSize; 378 *Buffer = AllocateZeroPool (*BufferSize); 378 *Buffer = AllocateZeroPool (*BufferSize); 379 379 if (*Buffer == NULL) { 380 380 DEBUG ((DEBUG_ERROR, "Can not allocate a buffer for the file!\n")); … … 382 382 goto Done; 383 383 } 384 384 385 385 // 386 386 // Load file into the allocated memory. … … 393 393 goto Done; 394 394 } 395 395 396 396 // 397 397 // Close file. … … 417 417 Hash the data to get credential. 418 418 419 @param[in] Buffer Points to the data buffer 419 @param[in] Buffer Points to the data buffer 420 420 @param[in] BufferSize The size of data in buffer, in bytes. 421 421 @param[out] Credential Points to the hashed result … … 423 423 @retval TRUE Hash the data successfully. 424 424 @retval FALSE Failed to hash the data. 425 425 426 426 **/ 427 427 BOOLEAN … … 435 435 UINTN HashSize; 436 436 VOID *Hash; 437 437 438 438 HashSize = Sha1GetContextSize (); 439 439 Hash = AllocatePool (HashSize); 440 440 ASSERT (Hash != NULL); 441 441 442 442 Status = Sha1Init (Hash); 443 443 if (!Status) { 444 444 goto Done; 445 445 } 446 446 447 447 Status = Sha1Update (Hash, Buffer, BufferSize); 448 448 if (!Status) { 449 449 goto Done; 450 450 } 451 451 452 452 Status = Sha1Final (Hash, Credential); 453 453 454 454 Done: 455 455 FreePool (Hash); … … 465 465 @retval EFI_SUCCESS Read a Token successfully. 466 466 @retval Others Fails to read a Token. 467 467 468 468 **/ 469 469 EFI_STATUS … … 485 485 return Status; 486 486 } 487 487 488 488 if (!GenerateCredential (Buffer, BufSize, Token)) { 489 489 DEBUG ((DEBUG_ERROR, "Generate credential from read data failed!\n")); … … 491 491 return EFI_SECURITY_VIOLATION; 492 492 } 493 494 FreePool (Buffer); 493 494 FreePool (Buffer); 495 495 return EFI_SUCCESS; 496 496 } … … 500 500 Find a user infomation record by the information record type. 501 501 502 This function searches all user information records of User from beginning 502 This function searches all user information records of User from beginning 503 503 until either the information is found or there are no more user infomation 504 504 record. A match occurs when a Info.InfoType field matches the user information 505 505 record type. 506 506 507 @param[in] User Points to the user profile record to search. 507 @param[in] User Points to the user profile record to search. 508 508 @param[in] InfoType The infomation type to be searched. 509 509 @param[out] Info Points to the user info found, the caller is responsible 510 510 to free. 511 511 512 512 @retval EFI_SUCCESS Find the user information successfully. 513 513 @retval Others Fail to find the user information. … … 526 526 EFI_USER_INFO_HANDLE UserInfoHandle; 527 527 EFI_USER_MANAGER_PROTOCOL *UserManager; 528 528 529 529 // 530 530 // Find user information by information type. … … 589 589 *Info = UserInfo; 590 590 return EFI_SUCCESS; 591 } 591 } 592 592 } 593 593 … … 612 612 { 613 613 USB_PROVIDER_CALLBACK_INFO *CallbackInfo; 614 614 615 615 // 616 616 // Initialize driver private data. … … 620 620 return EFI_OUT_OF_RESOURCES; 621 621 } 622 622 623 623 CallbackInfo->DriverHandle = NULL; 624 624 … … 644 644 Enroll a user on a credential provider. 645 645 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; 648 648 otherwise add the user information on credential provider. 649 649 650 650 @param[in] This Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL. 651 651 @param[in] User The user profile to enroll. 652 652 653 653 @retval EFI_SUCCESS User profile was successfully enrolled. 654 654 @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the 655 655 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 657 657 other than the current user profile. 658 658 @retval EFI_UNSUPPORTED This credential provider does not support enrollment in … … 661 661 error. 662 662 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle. 663 663 664 664 **/ 665 665 EFI_STATUS … … 682 682 return EFI_INVALID_PARAMETER; 683 683 } 684 684 685 685 // 686 686 // Get User Identifier … … 696 696 } 697 697 698 CopyMem (UsbInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER)); 698 CopyMem (UsbInfo.UserId, (UINT8 *) (UserInfo + 1), sizeof (EFI_USER_INFO_IDENTIFIER)); 699 699 FreePool (UserInfo); 700 700 701 701 // 702 702 // Get Token and User ID to UsbInfo. … … 705 705 if (EFI_ERROR (Status)) { 706 706 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)); 708 708 CreatePopUp ( 709 709 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, … … 717 717 FreePool (PromptStr); 718 718 return Status; 719 } 719 } 720 720 721 721 // 722 722 // Check whether User is ever enrolled in the provider. 723 // 723 // 724 724 for (Index = 0; Index < mUsbTable->Count; Index++) { 725 725 UserId = (UINT8 *) &mUsbTable->UserInfo[Index].UserId; … … 727 727 // 728 728 // User already exists, update the password. 729 // 729 // 730 730 break; 731 731 } 732 732 } 733 733 734 734 // 735 735 // Enroll the User to the provider. … … 749 749 This function returns information about the form used when interacting with the 750 750 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 752 752 the user credential provider does not require a form to identify the user, then this 753 753 function should return EFI_NOT_FOUND. … … 757 757 @param[out] FormSetId On return, holds the identifier of the form set which contains 758 758 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 760 760 identification. 761 761 762 762 @retval EFI_SUCCESS Form returned successfully. 763 763 @retval EFI_NOT_FOUND Form not returned. 764 764 @retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL. 765 765 766 766 **/ 767 767 EFI_STATUS … … 774 774 ) 775 775 { 776 if ((This == NULL) || (Hii == NULL) || 776 if ((This == NULL) || (Hii == NULL) || 777 777 (FormSetId == NULL) || (FormId == NULL)) { 778 778 return EFI_INVALID_PARAMETER; … … 787 787 This optional function returns a bitmap which is less than or equal to the number 788 788 of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND 789 is returned. 789 is returned. 790 790 791 791 @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 794 794 width of the bitmap returned. 795 795 @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 797 797 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 801 801 @retval EFI_SUCCESS Image identifier returned successfully. 802 802 @retval EFI_NOT_FOUND Image identifier not returned. 803 803 @retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL. 804 804 805 805 **/ 806 806 EFI_STATUS … … 825 825 826 826 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. 828 828 829 829 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 830 830 @param[out] Hii On return, holds the HII database handle. 831 831 @param[out] String On return, holds the HII string identifier. 832 832 833 833 @retval EFI_SUCCESS String identifier returned successfully. 834 834 @retval EFI_NOT_FOUND String identifier not returned. 835 835 @retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL. 836 836 837 837 **/ 838 838 EFI_STATUS … … 861 861 862 862 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 864 864 submitted on a form OR after a call to Default() has returned that this credential is 865 865 ready to log on. 866 866 867 867 @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 869 869 considered by the user identity manager. If NULL, then no user 870 870 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 873 873 @retval EFI_SUCCESS User identifier returned successfully. 874 874 @retval EFI_NOT_READY No user identifier can be returned. … … 877 877 @retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be 878 878 found in user profile database. 879 879 880 880 **/ 881 881 EFI_STATUS … … 892 892 UINT8 *UserId; 893 893 UINT8 *NewUserId; 894 UINT8 *UserToken; 894 UINT8 *UserToken; 895 895 UINT8 ReadToken[HASHED_CREDENTIAL_LEN]; 896 896 EFI_INPUT_KEY Key; 897 897 CHAR16 *QuestionStr; 898 898 CHAR16 *PromptStr; 899 899 900 900 if ((This == NULL) || (Identifier == NULL)) { 901 901 return EFI_INVALID_PARAMETER; 902 902 } 903 903 904 904 if (User == NULL) { 905 905 // … … 909 909 return EFI_NOT_READY; 910 910 } 911 911 912 912 // 913 913 // No user selected, get token first and verify the user existed in user database. … … 917 917 return EFI_NOT_READY; 918 918 } 919 919 920 920 for (Index = 0; Index < mUsbTable->Count; Index++) { 921 921 // … … 930 930 } 931 931 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 938 938 // with read token. 939 // 940 939 // 940 941 941 Status = GetToken (ReadToken); 942 942 if (EFI_ERROR (Status)) { … … 962 962 if (EFI_ERROR (Status)) { 963 963 return EFI_NOT_FOUND; 964 } 965 964 } 965 966 966 // 967 967 // Check the selected user's Token with the read token. … … 982 982 FreePool (UserInfo); 983 983 return EFI_SUCCESS; 984 } 985 } 986 } 987 988 FreePool (UserInfo); 989 984 } 985 } 986 } 987 988 FreePool (UserInfo); 989 990 990 return EFI_NOT_READY; 991 991 } … … 995 995 Indicate that user interface interaction has begun for the specified credential. 996 996 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 998 998 AutoLogon returns FALSE, then the user interface will be constructed by the User 999 Identity Manager. 999 Identity Manager. 1000 1000 1001 1001 @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 1005 1005 @retval EFI_SUCCESS Credential provider successfully selected. 1006 1006 @retval EFI_INVALID_PARAMETER AutoLogon is NULL. 1007 1007 1008 1008 **/ 1009 1009 EFI_STATUS … … 1030 1030 1031 1031 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 1032 1032 1033 1033 @retval EFI_SUCCESS Credential provider successfully deselected. 1034 1034 1035 1035 **/ 1036 1036 EFI_STATUS … … 1050 1050 Return the default logon behavior for this user credential. 1051 1051 1052 This function reports the default login behavior regarding this credential provider. 1052 This function reports the default login behavior regarding this credential provider. 1053 1053 1054 1054 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 1055 1055 @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 1058 1058 @retval EFI_SUCCESS Default information successfully returned. 1059 1059 @retval EFI_INVALID_PARAMETER AutoLogon is NULL. 1060 1060 1061 1061 **/ 1062 1062 EFI_STATUS … … 1079 1079 Return information attached to the credential provider. 1080 1080 1081 This function returns user information. 1081 This function returns user information. 1082 1082 1083 1083 @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. 1085 1085 @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On 1086 1086 exit, holds the user information. If the buffer is too small … … 1088 1088 and InfoSize is updated to contain the number of bytes actually 1089 1089 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 1093 1093 @retval EFI_SUCCESS Information returned successfully. 1094 1094 @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the 1095 1095 user information. The size required is returned in *InfoSize. 1096 1096 @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 1099 1099 **/ 1100 1100 EFI_STATUS … … 1109 1109 EFI_USER_INFO *CredentialInfo; 1110 1110 UINTN Index; 1111 1111 1112 1112 if ((This == NULL) || (InfoSize == NULL) || (Info == NULL)) { 1113 1113 return EFI_INVALID_PARAMETER; … … 1117 1117 return EFI_NOT_FOUND; 1118 1118 } 1119 1119 1120 1120 // 1121 1121 // Find information handle in credential info table. … … 1131 1131 return EFI_BUFFER_TOO_SMALL; 1132 1132 } 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 1139 1139 return EFI_NOT_FOUND; 1140 1140 } … … 1147 1147 information record handle, point UserInfo at a NULL. Each subsequent call will retrieve 1148 1148 another user information record handle until there are no more, at which point UserInfo 1149 will point to NULL. 1149 will point to NULL. 1150 1150 1151 1151 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. … … 1153 1153 to start enumeration. On exit, points to the next user information 1154 1154 handle or NULL if there is no more user information. 1155 1155 1156 1156 @retval EFI_SUCCESS User information returned. 1157 1157 @retval EFI_NOT_FOUND No more user information found. 1158 1158 @retval EFI_INVALID_PARAMETER UserInfo is NULL. 1159 1159 1160 1160 **/ 1161 1161 EFI_STATUS … … 1171 1171 UINTN Index; 1172 1172 UINTN ProvStrLen; 1173 1173 1174 1174 if ((This == NULL) || (UserInfo == NULL)) { 1175 1175 return EFI_INVALID_PARAMETER; … … 1193 1193 Info = AllocateZeroPool (InfoLen); 1194 1194 ASSERT (Info != NULL); 1195 1195 1196 1196 Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_RECORD; 1197 1197 Info->InfoSize = (UINT32) InfoLen; … … 1199 1199 CopyGuid (&Info->Credential, &gUsbCredentialProviderGuid); 1200 1200 CopyGuid ((EFI_GUID *)(Info + 1), &gUsbCredentialProviderGuid); 1201 1201 1202 1202 mUsbInfoHandle->Info[0] = Info; 1203 1203 mUsbInfoHandle->Count++; … … 1211 1211 Info = AllocateZeroPool (InfoLen); 1212 1212 ASSERT (Info != NULL); 1213 1213 1214 1214 Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD; 1215 1215 Info->InfoSize = (UINT32) InfoLen; … … 1218 1218 CopyMem ((UINT8*)(Info + 1), ProvNameStr, ProvStrLen); 1219 1219 FreePool (ProvNameStr); 1220 1220 1221 1221 mUsbInfoHandle->Info[1] = Info; 1222 1222 mUsbInfoHandle->Count++; … … 1228 1228 Info = AllocateZeroPool (InfoLen); 1229 1229 ASSERT (Info != NULL); 1230 1230 1231 1231 Info->InfoType = EFI_USER_INFO_CREDENTIAL_TYPE_RECORD; 1232 1232 Info->InfoSize = (UINT32) InfoLen; … … 1234 1234 CopyGuid (&Info->Credential, &gUsbCredentialProviderGuid); 1235 1235 CopyGuid ((EFI_GUID *)(Info + 1), &gEfiUserCredentialClassSecureCardGuid); 1236 1236 1237 1237 mUsbInfoHandle->Info[2] = Info; 1238 1238 mUsbInfoHandle->Count++; 1239 1239 1240 1240 // 1241 1241 // The fourth information, Credential Provider type name info. … … 1246 1246 Info = AllocateZeroPool (InfoLen); 1247 1247 ASSERT (Info != NULL); 1248 1248 1249 1249 Info->InfoType = EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD; 1250 1250 Info->InfoSize = (UINT32) InfoLen; … … 1253 1253 CopyMem ((UINT8*)(Info + 1), ProvNameStr, ProvStrLen); 1254 1254 FreePool (ProvNameStr); 1255 1255 1256 1256 mUsbInfoHandle->Info[3] = Info; 1257 1257 mUsbInfoHandle->Count++; 1258 1258 } 1259 1259 1260 1260 if (*UserInfo == NULL) { 1261 1261 // … … 1265 1265 return EFI_SUCCESS; 1266 1266 } 1267 1267 1268 1268 // 1269 1269 // Find information handle in credential info table. … … 1284 1284 Index++; 1285 1285 *UserInfo = (EFI_USER_INFO_HANDLE)mUsbInfoHandle->Info[Index]; 1286 return EFI_SUCCESS; 1286 return EFI_SUCCESS; 1287 1287 } 1288 1288 } … … 1296 1296 Delete a user on this credential provider. 1297 1297 1298 This function deletes a user on this credential provider. 1298 This function deletes a user on this credential provider. 1299 1299 1300 1300 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. … … 1302 1302 1303 1303 @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. 1307 1307 @retval EFI_UNSUPPORTED This credential provider does not support deletion in the pre-OS. 1308 1308 @retval EFI_DEVICE_ERROR The new credential could not be deleted because of a device error. … … 1321 1321 UINT8 *NewUserId; 1322 1322 UINTN Index; 1323 1323 1324 1324 if ((This == NULL) || (User == NULL)) { 1325 1325 return EFI_INVALID_PARAMETER; … … 1341 1341 // 1342 1342 // Find the user by user identifier in mPwdTable. 1343 // 1343 // 1344 1344 for (Index = 0; Index < mUsbTable->Count; Index++) { 1345 1345 UserId = (UINT8 *) &mUsbTable->UserInfo[Index].UserId; … … 1389 1389 return Status; 1390 1390 } 1391 1391 1392 1392 // 1393 1393 // Init Form Browser … … 1397 1397 return Status; 1398 1398 } 1399 1399 1400 1400 // 1401 1401 // Install protocol interfaces for the Usb Credential Provider. -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProvider.h
r48674 r58466 1 1 /** @file 2 2 Usb Credential Provider driver header file. 3 3 4 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 81 81 Enroll a user on a credential provider. 82 82 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 87 87 provider. 88 88 89 89 @param[in] This Points to this instance of EFI_USER_CREDENTIAL2_PROTOCOL. 90 90 @param[in] User The user profile to enroll. 91 91 92 92 @retval EFI_SUCCESS User profile was successfully enrolled. 93 93 @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the 94 94 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 96 96 other than the current user profile. 97 97 @retval EFI_UNSUPPORTED This credential provider does not support enrollment in … … 100 100 error. 101 101 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle. 102 102 103 103 **/ 104 104 EFI_STATUS … … 112 112 Returns the user interface information used during user identification. 113 113 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; 116 116 otherwise delete the user information on credential provider. 117 117 … … 120 120 @param[out] FormSetId On return, holds the identifier of the form set which contains 121 121 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 123 123 identification. 124 124 125 125 @retval EFI_SUCCESS Form returned successfully. 126 126 @retval EFI_NOT_FOUND Form not returned. 127 127 @retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL. 128 128 129 129 **/ 130 130 EFI_STATUS … … 142 142 This optional function returns a bitmap which is less than or equal to the number 143 143 of pixels specified by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND 144 is returned. 144 is returned. 145 145 146 146 @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 149 149 width of the bitmap returned. 150 150 @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 152 152 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 156 156 @retval EFI_SUCCESS Image identifier returned successfully. 157 157 @retval EFI_NOT_FOUND Image identifier not returned. 158 158 @retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL. 159 159 160 160 **/ 161 161 EFI_STATUS … … 173 173 174 174 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. 176 176 177 177 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 178 178 @param[out] Hii On return, holds the HII database handle. 179 179 @param[out] String On return, holds the HII string identifier. 180 180 181 181 @retval EFI_SUCCESS String identifier returned successfully. 182 182 @retval EFI_NOT_FOUND String identifier not returned. 183 183 @retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL. 184 184 185 185 **/ 186 186 EFI_STATUS … … 196 196 197 197 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 199 199 submitted on a form OR after a call to Default() has returned that this credential is 200 200 ready to log on. 201 201 202 202 @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 204 204 considered by the user identity manager. If NULL, then no user 205 205 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 208 208 @retval EFI_SUCCESS User identifier returned successfully. 209 209 @retval EFI_NOT_READY No user identifier can be returned. … … 212 212 @retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be 213 213 found in user profile database. 214 214 215 215 **/ 216 216 EFI_STATUS … … 225 225 Indicate that user interface interaction has begun for the specified credential. 226 226 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 228 228 AutoLogon returns FALSE, then the user interface will be constructed by the User 229 Identity Manager. 229 Identity Manager. 230 230 231 231 @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 235 235 @retval EFI_SUCCESS Credential provider successfully selected. 236 236 @retval EFI_INVALID_PARAMETER AutoLogon is NULL. 237 237 238 238 **/ 239 239 EFI_STATUS … … 250 250 251 251 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 252 252 253 253 @retval EFI_SUCCESS Credential provider successfully deselected. 254 254 255 255 **/ 256 256 EFI_STATUS … … 263 263 Return the default logon behavior for this user credential. 264 264 265 This function reports the default login behavior regarding this credential provider. 265 This function reports the default login behavior regarding this credential provider. 266 266 267 267 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. 268 268 @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 271 271 @retval EFI_SUCCESS Default information successfully returned. 272 272 @retval EFI_INVALID_PARAMETER AutoLogon is NULL. … … 283 283 Return information attached to the credential provider. 284 284 285 This function returns user information. 285 This function returns user information. 286 286 287 287 @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. 289 289 @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On 290 290 exit, holds the user information. If the buffer is too small … … 292 292 and InfoSize is updated to contain the number of bytes actually 293 293 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 297 297 @retval EFI_SUCCESS Information returned successfully. 298 298 @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the 299 299 user information. The size required is returned in *InfoSize. 300 300 @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 303 303 **/ 304 304 EFI_STATUS … … 317 317 information record handle, point UserInfo at a NULL. Each subsequent call will retrieve 318 318 another user information record handle until there are no more, at which point UserInfo 319 will point to NULL. 319 will point to NULL. 320 320 321 321 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. … … 323 323 to start enumeration. On exit, points to the next user information 324 324 handle or NULL if there is no more user information. 325 325 326 326 @retval EFI_SUCCESS User information returned. 327 327 @retval EFI_NOT_FOUND No more user information found. 328 328 @retval EFI_INVALID_PARAMETER UserInfo is NULL. 329 329 330 330 **/ 331 331 EFI_STATUS … … 339 339 Delete a user on this credential provider. 340 340 341 This function deletes a user on this credential provider. 341 This function deletes a user on this credential provider. 342 342 343 343 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL. … … 345 345 346 346 @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. 350 350 @retval EFI_UNSUPPORTED This credential provider does not support deletion in the pre-OS. 351 351 @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 2 2 # Provides a USB credential provider implementation 3 3 # 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 5 5 # folder of a USB stick. The token file name can be specified by the PCD 6 6 # PcdFixedUsbCredentialProviderTokenFileName. … … 46 46 UefiLib 47 47 BaseCryptLib 48 48 49 49 [Guids] 50 50 ## PRODUCES ## Variable:L"UsbCredential" … … 53 53 ## SOMETIMES_CONSUMES ## GUID # The credential provider identifier 54 54 gUsbCredentialProviderGuid 55 55 56 56 gEfiFileInfoGuid ## SOMETIMES_CONSUMES ## GUID 57 57 gEfiUserCredentialClassSecureCardGuid ## SOMETIMES_CONSUMES ## GUID 58 58 59 59 [Pcd] 60 gEfiSecurityPkgTokenSpaceGuid.PcdFixedUsbCredentialProviderTokenFileName ## SOMETIMES_CONSUMES 60 gEfiSecurityPkgTokenSpaceGuid.PcdFixedUsbCredentialProviderTokenFileName ## SOMETIMES_CONSUMES 61 61 62 62 [Protocols] … … 65 65 gEfiBlockIoProtocolGuid ## SOMETIMES_CONSUMES 66 66 gEfiSimpleFileSystemProtocolGuid ## SOMETIMES_CONSUMES 67 67 68 68 [UserExtensions.TianoCore."ExtraFiles"] 69 69 UsbCredentialProviderExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProviderStrings.uni
-
Property svn:mime-type
changed from
application/octet-stream
totext/plain;encoding=UTF-16LE
-
Property svn:mime-type
changed from
-
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/LoadDeferredImage.c
r48674 r58466 1 1 /** @file 2 2 Load the deferred images after user is identified. 3 3 4 4 Copyright (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 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 40 40 EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath; 41 41 VOID *DriverImage; 42 UINTN ImageSize; 42 UINTN ImageSize; 43 43 BOOLEAN BootOption; 44 44 EFI_HANDLE ImageHandle; … … 78 78 // 79 79 Status = DeferredImage->GetImageInfo( 80 DeferredImage, 81 DriverIndex, 82 &ImageDevicePath, 80 DeferredImage, 81 DriverIndex, 82 &ImageDevicePath, 83 83 (VOID **) &DriverImage, 84 &ImageSize, 84 &ImageSize, 85 85 &BootOption 86 86 ); 87 87 if (EFI_ERROR (Status)) { 88 88 break; 89 } 89 } 90 90 91 91 // … … 107 107 gBS->SetWatchdogTimer (5 * 60, 0x0000, 0x00, NULL); 108 108 Status = gBS->StartImage (ImageHandle, &ExitDataSize, &ExitData); 109 109 110 110 // 111 111 // Clear the Watchdog Timer after the image returns. … … 116 116 } while (TRUE); 117 117 } 118 FreePool (HandleBuf); 118 FreePool (HandleBuf); 119 119 } 120 120 … … 135 135 136 136 mDeferredImageHandle = ImageHandle; 137 137 138 138 Status = gBS->CreateEventEx ( 139 139 EVT_NOTIFY_SIGNAL, -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c
r58459 r58466 1 1 /** @file 2 2 This driver manages user information and produces user manager protocol. 3 3 4 4 Copyright (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 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 81 81 Find the specified user in the user database. 82 82 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. 87 87 On return, points to the user profile entry or NULL if not found. 88 88 @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 92 92 user specifyed by User. 93 93 94 94 @retval EFI_NOT_FOUND User was NULL, or User was not found, or the next user was not found. 95 95 @retval EFI_SUCCESS User or the next user are found in user profile database 96 96 97 97 **/ 98 98 EFI_STATUS … … 111 111 return EFI_NOT_FOUND; 112 112 } 113 113 114 114 // 115 115 // Check whether the user profile is in the user profile database. … … 152 152 Find the specified user information record in the specified User profile. 153 153 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. 158 158 @param[in, out] Info On entry, points to the user information record or NULL to start 159 159 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. 161 161 @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. 164 164 @param[out] Offset A pointer to the offset of the information record in the user profile. 165 165 … … 167 167 @retval EFI_NOT_FOUND Info was not found, or the next Info was not found. 168 168 @retval EFI_SUCCESS Info or the next info are found in user profile. 169 169 170 170 **/ 171 171 EFI_STATUS … … 184 184 return EFI_INVALID_PARAMETER; 185 185 } 186 186 187 187 // 188 188 // Check user profile entry … … 207 207 InfoLen += ALIGN_VARIABLE (UserInfo->InfoSize); 208 208 } 209 209 210 210 // 211 211 // Check whether to find the next user information. … … 245 245 Find a user infomation record by the information record type. 246 246 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 249 249 or there are no more user infomation record. 250 250 A match occurs when a Info.InfoType field matches the user information record type. 251 251 252 @param[in] User Points to the user profile record to search. 252 @param[in] User Points to the user profile record to search. 253 253 @param[in, out] Info On entry, points to the user information record or NULL to start 254 254 searching with the first user information record. … … 257 257 258 258 @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. 260 260 @retval EFI_INVALID_PARAMETER User is NULL or Info is NULL. 261 261 262 262 **/ 263 263 EFI_STATUS … … 275 275 return EFI_INVALID_PARAMETER; 276 276 } 277 277 278 278 // 279 279 // Check whether the user has the specified user information. … … 289 289 return EFI_NOT_FOUND; 290 290 } 291 291 292 292 while (InfoLen < User->UserProfileSize) { 293 293 UserInfo = (EFI_USER_INFO *) (User->ProfileInfo + InfoLen); … … 309 309 Find a user using a user information record. 310 310 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 313 313 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 315 315 user information record data matches the portion of Info passed the EFI_USER_INFO header. 316 316 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. 319 319 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. 322 322 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 324 324 to the user information record. 325 325 @param[in] InfoSize The size of Info, in bytes. Same as Info->InfoSize. 326 326 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, 328 328 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. 330 330 @retval EFI_INVALID_PARAMETER User is NULL; Info is NULL; or, InfoSize is too small. 331 331 332 332 **/ 333 333 EFI_STATUS … … 362 362 *User = mUserProfileDb->UserProfile[0]; 363 363 } 364 364 365 365 // 366 366 // Check user profile handle. … … 377 377 break; 378 378 } 379 379 380 380 if (InfoSize == Info->InfoSize) { 381 381 if (CompareMem ((UINT8 *) (InfoEntry + 1), (UINT8 *) (Info + 1), InfoSize - sizeof (EFI_USER_INFO)) == 0) { … … 388 388 return EFI_SUCCESS; 389 389 } 390 } 391 } 392 390 } 391 } 392 393 393 // 394 394 // Get next user profile. … … 410 410 @retval TRUE The policy is a valid access policy. 411 411 @retval FALSE The access policy is not a valid access policy. 412 412 413 413 **/ 414 414 BOOLEAN … … 430 430 // Check access policy according to type. 431 431 // 432 CopyMem (&Access, PolicyInfo + TotalLen, sizeof (Access)); 432 CopyMem (&Access, PolicyInfo + TotalLen, sizeof (Access)); 433 433 ValueLen = Access.Size - sizeof (EFI_USER_INFO_ACCESS_CONTROL); 434 434 switch (Access.Type) { … … 492 492 @retval TRUE The policy is a valid identity policy. 493 493 @retval FALSE The access policy is not a valid identity policy. 494 494 495 495 **/ 496 496 BOOLEAN … … 602 602 @retval TRUE The info is a valid user information record. 603 603 @retval FALSE The info is not a valid user information record. 604 604 605 605 **/ 606 606 BOOLEAN … … 697 697 @retval TRUE It is a valid user profile. 698 698 @retval FALSE It is not a valid user profile. 699 699 700 700 **/ 701 701 BOOLEAN … … 711 711 return FALSE; 712 712 } 713 713 714 714 // 715 715 // Check user profile information length. … … 742 742 EFI_USER_INFO_ACCESS_ENROLL_OTHERS or 743 743 EFI_USER_INFO_ACCESS_ENROLL_SELF. 744 744 745 745 @retval TRUE Find the specified RightType in current user profile. 746 746 @retval FALSE Can't find the right in the profile. 747 747 748 748 **/ 749 749 BOOLEAN … … 882 882 @retval TRUE Success to expand user profile database. 883 883 @retval FALSE Fail to expand user profile database. 884 884 885 885 **/ 886 886 BOOLEAN … … 935 935 936 936 @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. 938 938 939 939 @retval TRUE Success to expand user profile size. 940 940 @retval FALSE Fail to expand user profile size. 941 941 942 942 **/ 943 943 BOOLEAN … … 959 959 return FALSE; 960 960 } 961 961 962 962 // 963 963 // Copy exist information. … … 981 981 @retval EFI_SUCCESS Save or delete user profile successfully. 982 982 @retval Others Fail to change the profile. 983 983 984 984 **/ 985 985 EFI_STATUS … … 998 998 return Status; 999 999 } 1000 1000 1001 1001 // 1002 1002 // Save the user profile to non-volatile memory. … … 1040 1040 return EFI_INVALID_PARAMETER; 1041 1041 } 1042 1042 1043 1043 // 1044 1044 // Check user profile handle. … … 1048 1048 return Status; 1049 1049 } 1050 1050 1051 1051 // 1052 1052 // Check user information memory size. … … 1057 1057 } 1058 1058 } 1059 1059 1060 1060 // 1061 1061 // Add new user information. … … 1083 1083 @param[in] User Point to the user profile. 1084 1084 @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. 1086 1086 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. 1088 1088 On return, points to the size of the user information. 1089 1089 @param[in] ChkRight If TRUE, check the user info attribute. … … 1093 1093 @retval EFI_ACCESS_DENIED The information cannot be accessed by the current user. 1094 1094 @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 1096 1096 returned data. The actual size required is returned in *InfoSize. 1097 1097 @retval EFI_SUCCESS Information returned successfully. … … 1116 1116 return EFI_INVALID_PARAMETER; 1117 1117 } 1118 1118 1119 1119 // 1120 1120 // Find the user information to get. … … 1124 1124 return Status; 1125 1125 } 1126 1126 1127 1127 // 1128 1128 // Check information attributes. … … 1145 1145 } 1146 1146 } 1147 1147 1148 1148 // 1149 1149 // Get user information. … … 1197 1197 return EFI_ACCESS_DENIED; 1198 1198 } 1199 1199 1200 1200 // 1201 1201 // Delete the specified user information. … … 1220 1220 @param[in] User Point to the user profile. 1221 1221 @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. 1223 1223 On return, points to the modified user information. 1224 1224 @param[in] Info Points to the new user information. … … 1249 1249 return EFI_INVALID_PARAMETER; 1250 1250 } 1251 1251 1252 1252 // 1253 1253 // Check user information. … … 1256 1256 return EFI_ACCESS_DENIED; 1257 1257 } 1258 1258 1259 1259 if (!CheckUserInfo (Info)) { 1260 1260 return EFI_INVALID_PARAMETER; … … 1274 1274 ASSERT (OldInfo != NULL); 1275 1275 1276 if (((OldInfo->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) || 1276 if (((OldInfo->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) || 1277 1277 ((Info->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0)) { 1278 1278 // … … 1292 1292 continue; 1293 1293 } 1294 1294 1295 1295 PayloadLen = Info->InfoSize - sizeof (EFI_USER_INFO); 1296 1296 if (PayloadLen == 0) { … … 1311 1311 return Status; 1312 1312 } 1313 1313 1314 1314 // 1315 1315 // Modify existing user information. … … 1319 1319 return EFI_INVALID_PARAMETER; 1320 1320 } 1321 1322 if (((Info->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) && 1321 1322 if (((Info->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) && 1323 1323 (OldInfo->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) == 0) { 1324 1324 // 1325 // Try to add exclusive attrib in new info. 1325 // Try to add exclusive attrib in new info. 1326 1326 // Check whether there is another information with the same type in profile. 1327 1327 // … … 1339 1339 return EFI_ACCESS_DENIED; 1340 1340 } 1341 } while (TRUE); 1341 } while (TRUE); 1342 1342 } 1343 1343 … … 1358 1358 @retval EFI_SUCCESS Delete user from the user profile successfully. 1359 1359 @retval Others Fail to delete user from user profile 1360 1360 1361 1361 **/ 1362 1362 EFI_STATUS … … 1375 1375 return EFI_INVALID_PARAMETER; 1376 1376 } 1377 1377 1378 1378 // 1379 1379 // Check whether it is the current user. … … 1382 1382 return EFI_ACCESS_DENIED; 1383 1383 } 1384 1384 1385 1385 // 1386 1386 // Delete user profile from the non-volatile memory. … … 1449 1449 return EFI_SECURITY_VIOLATION; 1450 1450 } 1451 1451 1452 1452 // 1453 1453 // Create user profile entry. … … 1468 1468 1469 1469 UnicodeSPrint ( 1470 User->UserVarName, 1470 User->UserVarName, 1471 1471 sizeof (User->UserVarName), 1472 L"User%04x", 1472 L"User%04x", 1473 1473 mUserProfileDb->UserProfileNum 1474 1474 ); … … 1532 1532 UserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV | EFI_USER_INFO_PUBLIC | EFI_USER_INFO_EXCLUSIVE; 1533 1533 GenerateUserId ((UINT8 *) (UserInfo + 1)); 1534 1534 1535 1535 // 1536 1536 // Add user profile to the user profile database. … … 1547 1547 @retval EFI_SUCCESS A default user profile is added successfully. 1548 1548 @retval Others Fail to add a default user profile 1549 1549 1550 1550 **/ 1551 1551 EFI_STATUS … … 1562 1562 EFI_USER_INFO_ACCESS_CONTROL *Access; 1563 1563 EFI_USER_INFO_IDENTITY_POLICY *Policy; 1564 1564 1565 1565 // 1566 1566 // Create a user profile. … … 1570 1570 return Status; 1571 1571 } 1572 1572 1573 1573 // 1574 1574 // Allocate a buffer to add all default user information. … … 1591 1591 goto Done; 1592 1592 } 1593 1593 1594 1594 // 1595 1595 // Add user profile create date record. … … 1609 1609 goto Done; 1610 1610 } 1611 1611 1612 1612 // 1613 1613 // Add user profile usage count record. … … 1623 1623 goto Done; 1624 1624 } 1625 1625 1626 1626 // 1627 1627 // Add user access right. … … 1638 1638 goto Done; 1639 1639 } 1640 1640 1641 1641 // 1642 1642 // Add user identity policy. … … 1646 1646 Policy = (EFI_USER_INFO_IDENTITY_POLICY *) (Info + 1); 1647 1647 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); 1649 1649 Info->InfoSize = sizeof (EFI_USER_INFO) + Policy->Length; 1650 1650 NewInfo = NULL; … … 1660 1660 Publish current user information into EFI System Configuration Table. 1661 1661 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 1663 1663 into the EFI System Configuration Table. Currently, only the user identifier and user 1664 1664 name are published. … … 1685 1685 if (!EFI_ERROR (Status)) { 1686 1686 // 1687 // The table existed! 1687 // The table existed! 1688 1688 // 1689 1689 return EFI_SUCCESS; … … 1707 1707 return Status; 1708 1708 } 1709 1709 1710 1710 // 1711 1711 // Allocate a buffer for user information table. 1712 1712 // 1713 1713 UserInfoTable = (EFI_USER_INFO_TABLE *) AllocateRuntimePool ( 1714 sizeof (EFI_USER_INFO_TABLE) + 1715 IdInfo->InfoSize + 1714 sizeof (EFI_USER_INFO_TABLE) + 1715 IdInfo->InfoSize + 1716 1716 NameInfo->InfoSize 1717 1717 ); … … 1721 1721 } 1722 1722 1723 UserInfoTable->Size = sizeof (EFI_USER_INFO_TABLE); 1724 1723 UserInfoTable->Size = sizeof (EFI_USER_INFO_TABLE); 1724 1725 1725 // 1726 1726 // Append the user information to the user info table … … 1740 1740 Get the user's identity type. 1741 1741 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 1743 1743 provider handles are connected by the operator 'AND' or 'OR'. 1744 1744 … … 1771 1771 } 1772 1772 ASSERT (IdentifyInfo != NULL); 1773 1773 1774 1774 // 1775 1775 // Search the user identify policy according to type. … … 1823 1823 return EFI_INVALID_PARAMETER; 1824 1824 } 1825 1825 1826 1826 // 1827 1827 // Check the user ID identified by the specified credential provider. … … 1843 1843 // 1844 1844 Status = UserCredential->Form ( 1845 UserCredential, 1846 &HiiHandle, 1847 &FormSetId, 1845 UserCredential, 1846 &HiiHandle, 1847 &FormSetId, 1848 1848 &FormId 1849 1849 ); 1850 if (!EFI_ERROR (Status)) { 1850 if (!EFI_ERROR (Status)) { 1851 1851 // 1852 1852 // Send form to get user input. … … 1863 1863 if (EFI_ERROR (Status)) { 1864 1864 return Status; 1865 } 1866 } 1865 } 1866 } 1867 1867 } 1868 1868 … … 1876 1876 return Status; 1877 1877 } 1878 1878 1879 1879 return EFI_SUCCESS; 1880 1880 } … … 1914 1914 return EFI_OUT_OF_RESOURCES; 1915 1915 } 1916 1916 1917 1917 // 1918 1918 // Check create date record. … … 1938 1938 } 1939 1939 } 1940 1940 1941 1941 // 1942 1942 // Update usage date record. … … 1961 1961 } 1962 1962 } 1963 1963 1964 1964 // 1965 1965 // Update usage count record. … … 2043 2043 2044 2044 @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. 2046 2046 @param[in] OpCodeHandle Points to container for dynamic created opcodes. 2047 2047 … … 2066 2066 return Status; 2067 2067 } 2068 2068 2069 2069 // 2070 2070 // Add user name selection. … … 2090 2090 /** 2091 2091 Identify the user whose identity policy does not contain the operator 'OR'. 2092 2092 2093 2093 @param[in] User Points to the user profile. 2094 2094 2095 2095 @retval EFI_SUCCESS The specified user is identified successfully. 2096 2096 @retval Others Fail to identify the user. 2097 2097 2098 2098 **/ 2099 2099 EFI_STATUS … … 2118 2118 } 2119 2119 ASSERT (IdentifyInfo != NULL); 2120 2120 2121 2121 // 2122 2122 // Check each part of identification policy expression. … … 2213 2213 /** 2214 2214 Identify the user whose identity policy does not contain the operator 'AND'. 2215 2215 2216 2216 @param[in] User Points to the user profile. 2217 2217 2218 2218 @retval EFI_SUCCESS The specified user is identified successfully. 2219 2219 @retval Others Fail to identify the user. 2220 2220 2221 2221 **/ 2222 2222 EFI_STATUS … … 2244 2244 } 2245 2245 ASSERT (IdentifyInfo != NULL); 2246 2246 2247 2247 // 2248 2248 // Initialize the container for dynamic opcodes. … … 2354 2354 return EFI_SUCCESS; 2355 2355 } 2356 2356 2357 2357 // 2358 2358 // Initialize the container for dynamic opcodes. … … 2360 2360 StartOpCodeHandle = HiiAllocateOpCodeHandle (); 2361 2361 ASSERT (StartOpCodeHandle != NULL); 2362 2362 2363 2363 EndOpCodeHandle = HiiAllocateOpCodeHandle (); 2364 2364 ASSERT (EndOpCodeHandle != NULL); 2365 2365 2366 2366 // 2367 2367 // Create Hii Extend Label OpCode. … … 2375 2375 StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL; 2376 2376 StartLabel->Number = LABEL_USER_NAME; 2377 2377 2378 2378 EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode ( 2379 2379 EndOpCodeHandle, … … 2384 2384 EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL; 2385 2385 EndLabel->Number = LABEL_END; 2386 2386 2387 2387 // 2388 2388 // Add all the user profile in the user profile database. … … 2392 2392 AddUserSelection ((UINT16)(LABEL_USER_NAME + Index), User, StartOpCodeHandle); 2393 2393 } 2394 2394 2395 2395 HiiUpdateForm ( 2396 2396 mCallbackInfo->HiiHandle, // HII handle … … 2400 2400 EndOpCodeHandle // Replace data 2401 2401 ); 2402 2402 2403 2403 HiiFreeOpCodeHandle (StartOpCodeHandle); 2404 2404 HiiFreeOpCodeHandle (EndOpCodeHandle); 2405 2405 2406 2406 return EFI_SUCCESS; 2407 2407 } … … 2415 2415 if (QuestionId >= LABEL_PROVIDER_NAME) { 2416 2416 // 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 2418 2418 // policy is OR type). Identify the user by the selected provider. 2419 2419 // … … 2426 2426 } 2427 2427 break; 2428 2428 2429 2429 case EFI_BROWSER_ACTION_CHANGING: 2430 2430 // … … 2483 2483 /** 2484 2484 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 2486 2486 profile database. 2487 2487 2488 2488 @retval EFI_SUCCESS Init user profile database successfully. 2489 2489 @retval Others Fail to init user profile database. 2490 2490 2491 2491 **/ 2492 2492 EFI_STATUS … … 2522 2522 return EFI_OUT_OF_RESOURCES; 2523 2523 } 2524 2524 2525 2525 // 2526 2526 // Get all user proifle entries. … … 2532 2532 // 2533 2533 UnicodeSPrint ( 2534 VarName, 2534 VarName, 2535 2535 sizeof (VarName), 2536 L"User%04x", 2536 L"User%04x", 2537 2537 Index 2538 2538 ); … … 2562 2562 break; 2563 2563 } 2564 2564 2565 2565 // 2566 2566 // Check variable attributes. … … 2570 2570 continue; 2571 2571 } 2572 2572 2573 2573 // 2574 2574 // Add user profile to the user profile database. … … 2602 2602 return Status; 2603 2603 } 2604 2604 2605 2605 // 2606 2606 // Check whether the user profile database is empty. … … 2629 2629 UINTN HandleCount; 2630 2630 EFI_HANDLE *HandleBuf; 2631 UINTN Index; 2631 UINTN Index; 2632 2632 2633 2633 if (mProviderDb != NULL) { … … 2658 2658 // 2659 2659 mProviderDb = AllocateZeroPool ( 2660 sizeof (CREDENTIAL_PROVIDER_INFO) - 2661 sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) + 2660 sizeof (CREDENTIAL_PROVIDER_INFO) - 2661 sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) + 2662 2662 HandleCount * sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) 2663 2663 ); … … 2816 2816 CallbackInfo->FormBrowser2 = FormBrowser2; 2817 2817 CallbackInfo->DriverHandle = NULL; 2818 2818 2819 2819 // 2820 2820 // Install Device Path Protocol and Config Access protocol to driver handle. … … 2890 2890 return Status; 2891 2891 } 2892 2892 2893 2893 // 2894 2894 // Find user with the specified user ID. … … 2909 2909 return EFI_NOT_READY; 2910 2910 } 2911 2911 2912 2912 return Status; 2913 2913 } … … 2918 2918 2919 2919 @param[in] ProtocolGuid Points to the protocol guid of sonsole . 2920 2920 2921 2921 @retval TRUE The given console is ready. 2922 2922 @retval FALSE The given console is not ready. 2923 2923 2924 2924 **/ 2925 2925 BOOLEAN 2926 2926 CheckConsole ( 2927 EFI_GUID *ProtocolGuid 2927 EFI_GUID *ProtocolGuid 2928 2928 ) 2929 2929 { … … 2931 2931 UINTN HandleCount; 2932 2932 EFI_HANDLE *HandleBuf; 2933 UINTN Index; 2933 UINTN Index; 2934 2934 EFI_DEVICE_PATH_PROTOCOL *DevicePath; 2935 2935 2936 2936 // 2937 2937 // Try to find all the handle driver. … … 2957 2957 } 2958 2958 } 2959 FreePool (HandleBuf); 2959 FreePool (HandleBuf); 2960 2960 return FALSE; 2961 2961 } … … 2967 2967 @retval TRUE The console is ready. 2968 2968 @retval FALSE The console is not ready. 2969 2969 2970 2970 **/ 2971 2971 BOOLEAN … … 2983 2983 } 2984 2984 } 2985 2985 2986 2986 return TRUE; 2987 2987 } … … 3039 3039 } 3040 3040 } 3041 3041 3042 3042 // 3043 3043 // Find and login the default & AutoLogon user. … … 3060 3060 } 3061 3061 } 3062 3062 3063 3063 if (!IsConsoleReady ()) { 3064 3064 // … … 3080 3080 NULL 3081 3081 ); 3082 3082 3083 3083 if (mIdentified) { 3084 3084 *User = (USER_PROFILE_ENTRY *) mCurrentUser; … … 3086 3086 return EFI_SUCCESS; 3087 3087 } 3088 3088 3089 3089 return EFI_ACCESS_DENIED; 3090 3090 } … … 3093 3093 /** 3094 3094 An empty function to pass error checking of CreateEventEx (). 3095 3095 3096 3096 @param Event Event whose notification function is being invoked. 3097 3097 @param Context Pointer to the notification function's context, … … 3138 3138 Create a new user profile. 3139 3139 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 3141 3141 its handle. The user profile is non-volatile, but the handle User can change across reboots. 3142 3142 3143 3143 @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. 3145 3145 The user profile handle is unique only during this boot. 3146 3146 3147 3147 @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 3149 3149 user profile. 3150 3150 @retval EFI_UNSUPPORTED Creation of new user profiles is not supported. 3151 3151 @retval EFI_INVALID_PARAMETER The User parameter is NULL. 3152 3152 3153 3153 **/ 3154 3154 EFI_STATUS … … 3173 3173 } 3174 3174 } 3175 3175 3176 3176 // 3177 3177 // Create new user profile … … 3189 3189 3190 3190 @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. 3192 3192 3193 3193 @retval EFI_SUCCESS User profile was successfully deleted. … … 3196 3196 @retval EFI_UNSUPPORTED Deletion of new user profiles is not supported. 3197 3197 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile. 3198 3198 3199 3199 **/ 3200 3200 EFI_STATUS … … 3210 3210 return EFI_INVALID_PARAMETER; 3211 3211 } 3212 3212 3213 3213 // 3214 3214 // Check the right of the current user. … … 3217 3217 return EFI_ACCESS_DENIED; 3218 3218 } 3219 3219 3220 3220 // 3221 3221 // Delete user profile. … … 3236 3236 Enumerate all of the enrolled users on the platform. 3237 3237 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. 3241 3241 3242 3242 @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 3244 3244 start enumeration. On exit, points to the next user profile handle 3245 3245 or NULL if there are no more user profiles. 3246 3246 3247 @retval EFI_SUCCESS Next enrolled user profile successfully returned. 3247 @retval EFI_SUCCESS Next enrolled user profile successfully returned. 3248 3248 @retval EFI_ACCESS_DENIED Next enrolled user profile was not successfully returned. 3249 3249 @retval EFI_INVALID_PARAMETER The User parameter is NULL. … … 3261 3261 return EFI_INVALID_PARAMETER; 3262 3262 } 3263 3263 3264 3264 Status = FindUserProfile ((USER_PROFILE_ENTRY **) User, TRUE, NULL); 3265 3265 if (EFI_ERROR (Status)) { … … 3276 3276 @param[out] CurrentUser On return, points to the current user profile handle. 3277 3277 3278 @retval EFI_SUCCESS Current user profile handle returned successfully. 3278 @retval EFI_SUCCESS Current user profile handle returned successfully. 3279 3279 @retval EFI_INVALID_PARAMETER The CurrentUser parameter is NULL. 3280 3280 3281 3281 **/ 3282 3282 EFI_STATUS … … 3286 3286 OUT EFI_USER_PROFILE_HANDLE *CurrentUser 3287 3287 ) 3288 { 3288 { 3289 3289 // 3290 3290 // Get current user profile. … … 3304 3304 Identify the user and, if authenticated, returns the user handle and changes the current 3305 3305 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 3308 3308 EFI_EVENT_GROUP_USER_PROFILE_CHANGED is signaled. 3309 3309 … … 3315 3315 @retval EFI_ACCESS_DENIED User was not successfully identified. 3316 3316 @retval EFI_INVALID_PARAMETER The User parameter is NULL. 3317 3317 3318 3318 **/ 3319 3319 EFI_STATUS … … 3334 3334 return EFI_SUCCESS; 3335 3335 } 3336 3336 3337 3337 // 3338 3338 // Identify user … … 3342 3342 return EFI_ACCESS_DENIED; 3343 3343 } 3344 3344 3345 3345 // 3346 3346 // Publish the user info into the EFI system configuration table. … … 3359 3359 3360 3360 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 3362 3362 continues until either the information is found or there are no more user profiles. 3363 3363 A match occurs when the Info.InfoType field matches the user information record … … 3365 3365 3366 3366 @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 3368 3368 handle, or NULL to start searching with the first user profile. 3369 3369 On return, points to the user profile handle, or NULL if not 3370 3370 found. 3371 3371 @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, 3373 3373 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 3380 3380 must be empty. 3381 3381 3382 @param[in] InfoSize The size of Info, in bytes. 3382 @param[in] InfoSize The size of Info, in bytes. 3383 3383 3384 3384 @retval EFI_SUCCESS User information was found. User points to the user profile 3385 3385 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 3387 3387 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 3390 3390 **/ 3391 3391 EFI_STATUS … … 3418 3418 } 3419 3419 } 3420 Size = Info->InfoSize; 3421 3420 Size = Info->InfoSize; 3421 3422 3422 // 3423 3423 // Find user profile accdoring to user information. … … 3436 3436 return EFI_NOT_FOUND; 3437 3437 } 3438 3438 3439 3439 return EFI_SUCCESS; 3440 3440 } … … 3444 3444 Return information attached to the user. 3445 3445 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 3450 3450 with a credential provider for which the user has not been authenticated. 3451 3451 3452 3452 @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. 3461 3461 3462 3462 @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 3464 3464 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 3466 3466 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 3468 3468 to a valid user info handle. 3469 3469 @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL. 3470 3470 3471 3471 **/ 3472 3472 EFI_STATUS … … 3489 3489 return EFI_INVALID_PARAMETER; 3490 3490 } 3491 3491 3492 3492 if ((User == NULL) || (UserInfo == NULL)) { 3493 3493 return EFI_NOT_FOUND; 3494 3494 } 3495 3495 3496 3496 Status = GetUserInfo (User, UserInfo, Info, InfoSize, TRUE); 3497 3497 if (EFI_ERROR (Status)) { … … 3508 3508 Add or update user information. 3509 3509 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 3512 3512 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 3514 3514 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 3516 3516 type already exists in the user profile, then EFI_ACCESS_DENIED will be returned and UserInfo 3517 3517 will point to the handle of the existing record. 3518 3518 3519 3519 @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. 3528 3528 3529 3529 @retval EFI_SUCCESS Information returned successfully. 3530 3530 @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 3532 3532 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 3534 3534 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. 3536 3536 **/ 3537 3537 EFI_STATUS … … 3550 3550 return EFI_INVALID_PARAMETER; 3551 3551 } 3552 3552 3553 3553 // 3554 3554 // Check the right of the current user. … … 3562 3562 return EFI_SECURITY_VIOLATION; 3563 3563 } 3564 3564 3565 3565 if (!CheckCurrentUserAccessRight (EFI_USER_INFO_ACCESS_ENROLL_OTHERS)) { 3566 3566 // … … 3582 3582 } 3583 3583 } 3584 3584 3585 3585 // 3586 3586 // Modify user information. … … 3589 3589 if (EFI_ERROR (Status)) { 3590 3590 if (Status == EFI_ACCESS_DENIED) { 3591 return EFI_ACCESS_DENIED; 3591 return EFI_ACCESS_DENIED; 3592 3592 } 3593 3593 return EFI_SECURITY_VIOLATION; … … 3600 3600 Called by credential provider to notify of information change. 3601 3601 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 3603 3603 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 3607 3607 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 3609 3609 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 3611 3611 current user, then logout current user and signal the EFI_EVENT_GROUP_USER_PROFILE_CHANGED event. 3612 3612 3613 3613 @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 3615 3615 where the user has changed. 3616 3616 … … 3618 3618 @retval EFI_NOT_READY The function was called while the specified credential provider was not selected. 3619 3619 @retval EFI_UNSUPPORTED The User Identity Manager doesn't support asynchronous notifications. 3620 3620 3621 3621 **/ 3622 3622 EFI_STATUS … … 3626 3626 IN EFI_HANDLE Changed 3627 3627 ) 3628 { 3628 { 3629 3629 return EFI_UNSUPPORTED; 3630 3630 } … … 3642 3642 @retval EFI_SUCCESS User information deleted successfully. 3643 3643 @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 3646 3646 **/ 3647 3647 EFI_STATUS … … 3658 3658 return EFI_INVALID_PARAMETER; 3659 3659 } 3660 3660 3661 3661 // 3662 3662 // Check the right of the current user. … … 3667 3667 } 3668 3668 } 3669 3669 3670 3670 // 3671 3671 // Delete user information. … … 3677 3677 } 3678 3678 return EFI_ACCESS_DENIED; 3679 } 3679 } 3680 3680 return EFI_SUCCESS; 3681 3681 } … … 3685 3685 Enumerate user information of all the enrolled users on the platform. 3686 3686 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. 3691 3691 3692 3692 @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL. … … 3697 3697 @retval EFI_NOT_FOUND No more user information found. 3698 3698 @retval EFI_INVALID_PARAMETER UserInfo is NULL. 3699 3699 3700 3700 **/ 3701 3701 EFI_STATUS … … 3755 3755 &gUserIdentifyManager 3756 3756 ); 3757 ASSERT_EFI_ERROR (Status); 3757 ASSERT_EFI_ERROR (Status); 3758 3758 3759 3759 LoadDeferredImageInit (ImageHandle); -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.h
r48674 r58466 1 1 /** @file 2 2 The header file for User identify Manager driver. 3 3 4 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 240 240 241 241 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 243 243 continues until either the information is found or there are no more user profiles. 244 244 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 246 246 EFI_USER_INFO header. 247 247 248 248 @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 250 250 handle, or NULL to start searching with the first user profile. 251 251 On return, points to the user profile handle, or NULL if not 252 252 found. 253 253 @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, 255 255 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, 261 261 then the user information record must be empty. 262 262 263 @param[in] InfoSize The size of Info, in bytes. 263 @param[in] InfoSize The size of Info, in bytes. 264 264 265 265 @retval EFI_SUCCESS User information was found. User points to the user profile handle, 266 266 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 268 268 points to NULL. 269 269 270 270 **/ 271 271 EFI_STATUS … … 410 410 IN OUT EFI_USER_INFO_HANDLE *UserInfo 411 411 ); 412 412 413 413 #endif -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerData.h
r48674 r58466 1 1 /** @file 2 2 Data structure used by the user identify manager driver. 3 3 4 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerDxe.inf
r58459 r58466 3 3 # 4 4 # This module manages user information and produces user manager protocol. 5 # 5 # 6 6 # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> 7 7 # This program and the accompanying materials … … 49 49 gEfiIfrTianoGuid ## SOMETIMES_CONSUMES ## GUID 50 50 gEfiEventUserProfileChangedGuid ## SOMETIMES_PRODUCES ## Event 51 51 52 52 ## SOMETIMES_PRODUCES ## Variable:L"Userxxxx" 53 53 ## SOMETIMES_CONSUMES ## Variable:L"Userxxxx" … … 65 65 gEfiHiiConfigAccessProtocolGuid ## PRODUCES 66 66 gEfiDevicePathProtocolGuid ## PRODUCES 67 67 68 68 ## PRODUCES 69 69 ## SOMETIMES_PRODUCES ## SystemTable 70 gEfiUserManagerProtocolGuid 70 gEfiUserManagerProtocolGuid 71 71 72 72 [Depex] 73 gEfiHiiDatabaseProtocolGuid AND 74 gEfiHiiStringProtocolGuid AND 75 gEfiFormBrowser2ProtocolGuid 73 gEfiHiiDatabaseProtocolGuid AND 74 gEfiHiiStringProtocolGuid AND 75 gEfiFormBrowser2ProtocolGuid 76 76 77 77 [UserExtensions.TianoCore."ExtraFiles"] -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerStrings.uni
-
Property svn:mime-type
changed from
application/octet-stream
totext/plain;encoding=UTF-16LE
-
Property svn:mime-type
changed from
-
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerVfr.Vfr
-
Property svn:eol-style
set to
native
r58459 r58466 3 3 4 4 Copyright (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 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 15 15 #include "UserIdentifyManagerData.h" 16 16 17 formset 17 formset 18 18 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), 21 21 classguid = USER_IDENTIFY_MANAGER_GUID, 22 22 23 23 form formid = FORMID_USER_FORM, 24 title = STRING_TOKEN(STR_USER_SELECT); 24 title = STRING_TOKEN(STR_USER_SELECT); 25 25 26 26 suppressif TRUE; … … 33 33 34 34 label LABEL_USER_NAME; 35 label LABEL_END; 35 label LABEL_END; 36 36 endform; 37 37 38 38 form formid = FORMID_PROVIDER_FORM, 39 39 title = STRING_TOKEN(STR_PROVIDER_SELECT); 40 40 label LABEL_PROVIDER_NAME; 41 41 label LABEL_END; 42 endform; 42 endform; 43 43 endformset; -
Property svn:eol-style
set to
-
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c
r58459 r58466 1 1 /** @file 2 2 The functions for access policy modification. 3 3 4 4 Copyright (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 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 16 16 17 17 /** 18 Collect all the access policy data to mUserInfo.AccessPolicy, 18 Collect all the access policy data to mUserInfo.AccessPolicy, 19 19 and save it to user profile. 20 20 … … 39 39 mUserInfo.AccessPolicyModified = TRUE; 40 40 OffSet = 0; 41 41 42 42 // 43 43 // Save access right. … … 52 52 CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control)); 53 53 OffSet += sizeof (Control); 54 54 55 55 // 56 56 // Save access setup. … … 62 62 63 63 Control.Type = EFI_USER_INFO_ACCESS_SETUP; 64 Control.Size = (UINT32) Size; 64 Control.Size = (UINT32) Size; 65 65 CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control)); 66 66 OffSet += sizeof (Control); 67 67 68 68 if (mAccessInfo.AccessSetup == ACCESS_SETUP_NORMAL) { 69 69 CopyGuid ((EFI_GUID *) (mUserInfo.AccessPolicy + OffSet), &gEfiUserInfoAccessSetupNormalGuid); … … 74 74 } 75 75 OffSet += sizeof (EFI_GUID); 76 76 77 77 // 78 78 // Save access of boot order. … … 84 84 85 85 Control.Type = EFI_USER_INFO_ACCESS_BOOT_ORDER; 86 Control.Size = (UINT32) Size; 86 Control.Size = (UINT32) Size; 87 87 CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control)); 88 88 OffSet += sizeof (Control); … … 90 90 CopyMem ((UINT8 *) (mUserInfo.AccessPolicy + OffSet), &mAccessInfo.AccessBootOrder, sizeof (UINT32)); 91 91 OffSet += sizeof (UINT32); 92 92 93 93 // 94 94 // Save permit load. … … 101 101 102 102 Control.Type = EFI_USER_INFO_ACCESS_PERMIT_LOAD; 103 Control.Size = (UINT32) Size; 103 Control.Size = (UINT32) Size; 104 104 CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control)); 105 105 OffSet += sizeof (Control); 106 106 107 107 CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.LoadPermit, mAccessInfo.LoadPermitLen); 108 108 OffSet += mAccessInfo.LoadPermitLen; 109 109 } 110 110 111 111 // 112 112 // Save forbid load. … … 119 119 120 120 Control.Type = EFI_USER_INFO_ACCESS_FORBID_LOAD; 121 Control.Size = (UINT32) Size; 121 Control.Size = (UINT32) Size; 122 122 CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control)); 123 123 OffSet += sizeof (Control); 124 124 125 125 CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.LoadForbid, mAccessInfo.LoadForbidLen); 126 126 OffSet += mAccessInfo.LoadForbidLen; 127 127 } 128 128 129 129 // 130 130 // Save permit connect. … … 137 137 138 138 Control.Type = EFI_USER_INFO_ACCESS_PERMIT_CONNECT; 139 Control.Size = (UINT32) Size; 139 Control.Size = (UINT32) Size; 140 140 CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control)); 141 141 OffSet += sizeof (Control); 142 142 143 143 CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.ConnectPermit, mAccessInfo.ConnectPermitLen); 144 144 OffSet += mAccessInfo.ConnectPermitLen; 145 145 } 146 146 147 147 // 148 148 // Save forbid connect. … … 155 155 156 156 Control.Type = EFI_USER_INFO_ACCESS_FORBID_CONNECT; 157 Control.Size = (UINT32) Size; 157 Control.Size = (UINT32) Size; 158 158 CopyMem (mUserInfo.AccessPolicy + OffSet, &Control, sizeof (Control)); 159 159 OffSet += sizeof (Control); 160 160 161 161 CopyMem (mUserInfo.AccessPolicy + OffSet, mAccessInfo.ConnectForbid, mAccessInfo.ConnectForbidLen); 162 162 OffSet += mAccessInfo.ConnectForbidLen; … … 265 265 266 266 /** 267 Check whether the DevicePath is in the device path forbid list 267 Check whether the DevicePath is in the device path forbid list 268 268 (mAccessInfo.LoadForbid). 269 269 270 270 @param[in] DevicePath Points to device path. 271 271 272 272 @retval TRUE The DevicePath is in the device path forbid list. 273 273 @retval FALSE The DevicePath is not in the device path forbid list. … … 331 331 OrderSize = 0; 332 332 Status = gRT->GetVariable ( 333 L"DriverOrder", 334 &gEfiGlobalVariableGuid, 335 NULL, 336 &OrderSize, 333 L"DriverOrder", 334 &gEfiGlobalVariableGuid, 335 NULL, 336 &OrderSize, 337 337 NULL 338 338 ); … … 347 347 348 348 Status = gRT->GetVariable ( 349 L"DriverOrder", 350 &gEfiGlobalVariableGuid, 351 NULL, 352 &OrderSize, 349 L"DriverOrder", 350 &gEfiGlobalVariableGuid, 351 NULL, 352 &OrderSize, 353 353 Order 354 354 ); … … 356 356 return ; 357 357 } 358 358 359 359 // 360 360 // Initialize the container for dynamic opcodes. … … 401 401 continue; 402 402 } 403 403 404 404 // 405 405 // Check whether the driver is already forbidden. 406 406 // 407 407 408 408 VarPtr = Var; 409 409 // … … 546 546 { 547 547 // 548 // Note: 548 // Note: 549 549 // As no architect protocol/interface to be called in ConnectController() 550 550 // to verify the device path, just add a place holder for permitted connect … … 564 564 { 565 565 // 566 // Note: 566 // Note: 567 567 // As no architect protocol/interface to be called in ConnectController() 568 568 // to verify the device path, just add a place holder for forbidden connect … … 573 573 574 574 /** 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 576 576 list (mAccessInfo.LoadForbid). 577 577 578 578 @param[in] DriverIndex The index of driver in forbidden device path list. 579 579 580 580 **/ 581 581 VOID … … 599 599 DriverIndex--; 600 600 } 601 601 602 602 // 603 603 // Specified device path found. … … 609 609 if (OffLen > 0) { 610 610 CopyMem ( 611 mAccessInfo.LoadForbid + OffSet, 612 mAccessInfo.LoadForbid + OffSet + DPSize, 611 mAccessInfo.LoadForbid + OffSet, 612 mAccessInfo.LoadForbid + OffSet + DPSize, 613 613 OffLen 614 614 ); … … 620 620 621 621 /** 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 623 623 list (mAccessInfo.LoadForbid). 624 624 625 625 @param[in] DriverIndex The index of driver saved in driver options. 626 626 627 627 **/ 628 628 VOID … … 646 646 return; 647 647 } 648 648 649 649 // 650 650 // Save forbid load driver. 651 651 // 652 652 653 653 VarPtr = Var; 654 654 // -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyIdentityPolicy.c
r48674 r58466 1 1 /** @file 2 2 The functions for identification policy modification. 3 3 4 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 21 21 22 22 @param[in] NewGuid Points to the credential provider guid. 23 23 24 24 @retval TRUE The NewGuid was found in the identity policy. 25 25 @retval FALSE The NewGuid was not found. … … 53 53 Offset += Identity->Length; 54 54 } 55 55 56 56 return FALSE; 57 57 } … … 71 71 EnrollUserOnProvider ( 72 72 IN EFI_USER_INFO_IDENTITY_POLICY *Identity, 73 IN EFI_USER_PROFILE_HANDLE User 73 IN EFI_USER_PROFILE_HANDLE User 74 74 ) 75 75 { 76 76 UINTN Index; 77 77 EFI_USER_CREDENTIAL2_PROTOCOL *UserCredential; 78 78 79 79 // 80 80 // Find the specified credential provider. … … 87 87 } 88 88 89 return EFI_NOT_FOUND; 89 return EFI_NOT_FOUND; 90 90 } 91 91 … … 104 104 DeleteUserOnProvider ( 105 105 IN EFI_USER_INFO_IDENTITY_POLICY *Identity, 106 IN EFI_USER_PROFILE_HANDLE User 106 IN EFI_USER_PROFILE_HANDLE User 107 107 ) 108 108 { 109 109 UINTN Index; 110 110 EFI_USER_CREDENTIAL2_PROTOCOL *UserCredential; 111 111 112 112 // 113 113 // Find the specified credential provider. … … 120 120 } 121 121 122 return EFI_NOT_FOUND; 122 return EFI_NOT_FOUND; 123 123 } 124 124 … … 126 126 /** 127 127 Delete User's credental from all the providers that exist in User's identity policy. 128 128 129 129 @param[in] IdentityPolicy Point to User's identity policy. 130 130 @param[in] IdentityPolicyLen The length of the identity policy. … … 136 136 IN UINT8 *IdentityPolicy, 137 137 IN UINTN IdentityPolicyLen, 138 IN EFI_USER_PROFILE_HANDLE User 138 IN EFI_USER_PROFILE_HANDLE User 139 139 ) 140 140 { … … 159 159 /** 160 160 Remove the provider specified by Offset from the new user identification record. 161 161 162 162 @param[in] IdentityPolicy Point to user identity item in new identification policy. 163 163 @param[in] Offset The item offset in the new identification policy. … … 188 188 // 189 189 // This provider is not the last item in the identification policy, delete it and the connector. 190 // 190 // 191 191 RemainingLen = mUserInfo.NewIdentityPolicyLen - Offset - DeleteLen; 192 192 CopyMem ((UINT8 *) IdentityPolicy, (UINT8 *) IdentityPolicy + DeleteLen, RemainingLen); 193 193 } 194 mUserInfo.NewIdentityPolicyLen -= DeleteLen; 194 mUserInfo.NewIdentityPolicyLen -= DeleteLen; 195 195 } 196 196 … … 202 202 203 203 @param[in] NewGuid Points to the credential provider guid. 204 204 205 205 **/ 206 206 VOID … … 249 249 FreePool (mUserInfo.NewIdentityPolicy); 250 250 } 251 251 252 252 // 253 253 // Save credential provider. … … 326 326 @retval TRUE The policy is a valid identity policy. 327 327 @retval FALSE The policy is not a valid identity policy. 328 328 329 329 **/ 330 330 BOOLEAN … … 338 338 UINTN Offset; 339 339 UINT32 OpCode; 340 340 341 341 // 342 342 // Check policy expression. … … 350 350 Identity = (EFI_USER_INFO_IDENTITY_POLICY *) (PolicyInfo + Offset); 351 351 switch (Identity->Type) { 352 352 353 353 case EFI_USER_INFO_IDENTITY_TRUE: 354 354 break; … … 409 409 /** 410 410 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, 413 413 the identity policy can be: T, P & P & P & ..., P | P | P | ... 414 414 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. 416 416 417 417 **/ … … 440 440 return ; 441 441 } 442 442 443 443 // 444 444 // Update the informantion on credential provider. … … 448 448 return ; 449 449 } 450 450 451 451 // 452 452 // Save new identification policy. … … 462 462 Status = mUserManager->SetInfo (mUserManager, mModifyUser, &UserInfo, Info, Info->InfoSize); 463 463 FreePool (Info); 464 464 465 465 // 466 466 // Update the mUserInfo.IdentityPolicy by mUserInfo.NewIdentityPolicy … … 474 474 mUserInfo.NewIdentityPolicy = NULL; 475 475 mUserInfo.NewIdentityPolicyLen = 0; 476 mUserInfo.NewIdentityPolicyModified = FALSE; 476 mUserInfo.NewIdentityPolicyModified = FALSE; 477 477 478 478 // … … 495 495 return ; 496 496 } 497 497 498 498 // 499 499 // Check the identity policy. -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileAdd.c
r48674 r58466 1 1 /** @file 2 2 The functions to add a user profile. 3 3 4 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 18 18 /** 19 19 Get user name from the popup windows. 20 20 21 21 @param[in, out] UserNameLen On entry, point to UserName buffer lengh, in bytes. 22 22 On exit, point to input user name length, in bytes. 23 23 @param[out] UserName The buffer to hold the input user name. 24 24 25 25 @retval EFI_ABORTED It is given up by pressing 'ESC' key. 26 26 @retval EFI_NOT_READY Not a valid input at all. … … 101 101 *UserNameLen = NameLen * sizeof (CHAR16); 102 102 CopyMem (UserName, Name, *UserNameLen); 103 103 104 104 return EFI_SUCCESS; 105 105 } … … 113 113 114 114 @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 116 116 username in mAddUserName. 117 117 … … 128 128 EFI_USER_PROFILE_HANDLE TempUser; 129 129 EFI_USER_INFO *NewUserInfo; 130 130 131 131 NewUserInfo = AllocateZeroPool (sizeof (EFI_USER_INFO) + UserNameLen); 132 132 ASSERT (NewUserInfo != NULL); 133 133 134 134 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 | 137 137 EFI_USER_INFO_EXCLUSIVE; 138 138 NewUserInfo->InfoSize = (UINT32) (sizeof (EFI_USER_INFO) + UserNameLen); … … 182 182 EFI_USER_INFO_CREATE_DATE Date; 183 183 EFI_USER_INFO *NewUserInfo; 184 184 185 185 NewUserInfo = AllocateZeroPool ( 186 186 sizeof (EFI_USER_INFO) + … … 190 190 191 191 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 | 194 194 EFI_USER_INFO_EXCLUSIVE; 195 195 NewUserInfo->InfoSize = sizeof (EFI_USER_INFO) + sizeof (EFI_USER_INFO_CREATE_DATE); … … 216 216 Set the default identity policy of the specified user. 217 217 218 @param[in] User Handle of a user profile. 218 @param[in] User Handle of a user profile. 219 219 220 220 **/ … … 227 227 EFI_USER_INFO_HANDLE UserInfo; 228 228 EFI_USER_INFO *NewUserInfo; 229 229 230 230 NewUserInfo = AllocateZeroPool ( 231 sizeof (EFI_USER_INFO) + 231 sizeof (EFI_USER_INFO) + 232 232 sizeof (EFI_USER_INFO_IDENTITY_POLICY) 233 233 ); 234 234 ASSERT (NewUserInfo != NULL); 235 235 236 236 Policy = (EFI_USER_INFO_IDENTITY_POLICY *) (NewUserInfo + 1); 237 237 Policy->Type = EFI_USER_INFO_IDENTITY_TRUE; … … 239 239 240 240 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 | 243 243 EFI_USER_INFO_EXCLUSIVE; 244 244 NewUserInfo->InfoSize = sizeof (EFI_USER_INFO) + Policy->Length; … … 258 258 Set the default access policy of the specified user. 259 259 260 @param[in] User Handle of a user profile. 260 @param[in] User Handle of a user profile. 261 261 262 262 **/ … … 269 269 EFI_USER_INFO_HANDLE UserInfo; 270 270 EFI_USER_INFO *NewUserInfo; 271 271 272 272 NewUserInfo = AllocateZeroPool ( 273 sizeof (EFI_USER_INFO) + 273 sizeof (EFI_USER_INFO) + 274 274 sizeof (EFI_USER_INFO_ACCESS_CONTROL) 275 275 ); 276 276 ASSERT (NewUserInfo != NULL); 277 277 278 278 Control = (EFI_USER_INFO_ACCESS_CONTROL *) (NewUserInfo + 1); 279 279 Control->Type = EFI_USER_INFO_ACCESS_ENROLL_SELF; … … 281 281 282 282 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 | 285 285 EFI_USER_INFO_EXCLUSIVE; 286 286 NewUserInfo->InfoSize = sizeof (EFI_USER_INFO) + Control->Size; … … 316 316 QuestionStr = NULL; 317 317 PromptStr = NULL; 318 318 319 319 // 320 320 // Get user name to add. … … 325 325 if (Status != EFI_ABORTED) { 326 326 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)); 328 328 goto Done; 329 329 } … … 338 338 if (EFI_ERROR (Status)) { 339 339 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)); 341 341 } else { 342 342 // … … 346 346 if (EFI_ERROR (Status)) { 347 347 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)); 349 349 goto Done; 350 350 } … … 355 355 356 356 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)); 358 358 } 359 359 -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c
r48674 r58466 1 1 /** @file 2 2 The functions to delete a user profile. 3 3 4 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 18 18 Get the username from the specified user. 19 19 20 @param[in] User Handle of a user profile. 20 @param[in] User Handle of a user profile. 21 21 22 22 @retval EFI_STRING_ID The String Id of the user's username. 23 23 24 24 **/ 25 EFI_STRING_ID 25 EFI_STRING_ID 26 26 GetUserName ( 27 27 IN EFI_USER_PROFILE_HANDLE User … … 36 36 CHAR16 UserName[USER_NAME_LENGTH]; 37 37 EFI_STRING_ID UserId; 38 38 39 39 // 40 40 // Allocate user information memory. … … 43 43 Info = AllocateZeroPool (MemSize); 44 44 ASSERT (Info != NULL); 45 45 46 46 // 47 47 // Get user name information. … … 117 117 Add a username item in form. 118 118 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. 120 120 @param[in] Index The index of the user in the user name list 121 121 @param[in] OpCodeHandle Points to container for dynamic created opcodes. … … 138 138 return ; 139 139 } 140 140 141 141 // 142 142 // Create user name option. … … 174 174 Delete the user specified by UserIndex in user profile database. 175 175 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 177 177 to be deleted. 178 178 … … 198 198 goto Done; 199 199 } 200 200 201 201 while (UserIndex > 1) { 202 202 Status = mUserManager->GetNext (mUserManager, &User); … … 233 233 DeleteCredentialFromProviders ((UINT8 *)(Info + 1), Info->InfoSize - sizeof (EFI_USER_INFO), User); 234 234 FreePool (Info); 235 235 236 236 Status = mUserManager->Delete (mUserManager, User); 237 237 if (EFI_ERROR (Status)) { … … 246 246 NULL 247 247 ); 248 return ; 248 return ; 249 249 } 250 250 -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c
r48674 r58466 1 1 /** @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 5 5 policy, etc. 6 6 7 7 Copyright (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 8 This program and the accompanying materials 9 are licensed and made available under the terms and conditions of the BSD License 10 which accompanies this distribution. The full text of the license may be found at 11 11 http://opensource.org/licenses/bsd-license.php 12 12 13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 15 … … 71 71 72 72 /** 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 74 74 to mProviderInfo. 75 75 76 76 @retval EFI_SUCESS Init credential provider database successfully. 77 77 @retval Others Fail to init credential provider database. 78 78 79 79 **/ 80 80 EFI_STATUS … … 86 86 UINTN HandleCount; 87 87 EFI_HANDLE *HandleBuf; 88 UINTN Index; 89 88 UINTN Index; 89 90 90 // 91 91 // Try to find all the user credential provider driver. … … 103 103 return Status; 104 104 } 105 105 106 106 // 107 107 // Get provider infomation. … … 111 111 } 112 112 mProviderInfo = AllocateZeroPool ( 113 sizeof (CREDENTIAL_PROVIDER_INFO) - 113 sizeof (CREDENTIAL_PROVIDER_INFO) - 114 114 sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) + 115 115 HandleCount * sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) … … 192 192 return EFI_SUCCESS; 193 193 } 194 194 195 195 // 196 196 // Get current user … … 202 202 return EFI_NOT_READY; 203 203 } 204 204 205 205 // 206 206 // Get current user's right information. … … 210 210 CurrentAccessRight = EFI_USER_INFO_ACCESS_ENROLL_SELF; 211 211 } 212 212 213 213 // 214 214 // Init credential provider information. … … 218 218 return Status; 219 219 } 220 220 221 221 // 222 222 // Initialize the container for dynamic opcodes. … … 224 224 StartOpCodeHandle = HiiAllocateOpCodeHandle (); 225 225 ASSERT (StartOpCodeHandle != NULL); 226 226 227 227 EndOpCodeHandle = HiiAllocateOpCodeHandle (); 228 228 ASSERT (EndOpCodeHandle != NULL); 229 229 230 230 // 231 231 // Create Hii Extend Label OpCode. … … 239 239 StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL; 240 240 StartLabel->Number = LABEL_USER_MANAGE_FUNC; 241 241 242 242 EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode ( 243 243 EndOpCodeHandle, … … 248 248 EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL; 249 249 EndLabel->Number = LABEL_END; 250 250 251 251 // 252 252 // Add user profile option. … … 264 264 ); 265 265 } 266 266 267 267 // 268 268 // Add modify user profile option. … … 276 276 KEY_MODIFY_USER // Question ID 277 277 ); 278 278 279 279 // 280 280 // Add delete user profile option … … 290 290 ); 291 291 } 292 292 293 293 HiiUpdateForm ( 294 294 mCallbackInfo->HiiHandle, // HII handle … … 298 298 EndOpCodeHandle // Replace data 299 299 ); 300 300 301 301 HiiFreeOpCodeHandle (StartOpCodeHandle); 302 302 HiiFreeOpCodeHandle (EndOpCodeHandle); 303 303 304 304 return EFI_SUCCESS; 305 305 } … … 311 311 312 312 case EFI_BROWSER_ACTION_CHANGED: 313 { 313 { 314 314 // 315 315 // Handle the request from form. … … 318 318 return EFI_INVALID_PARAMETER; 319 319 } 320 320 321 321 // 322 322 // Judge first 2 bits. … … 392 392 // Change credential provider option. 393 393 // 394 case KEY_MODIFY_PROV: 394 case KEY_MODIFY_PROV: 395 395 mProviderChoice = Value->u8; 396 396 break; … … 556 556 557 557 case EFI_BROWSER_ACTION_CHANGING: 558 { 558 { 559 559 // 560 560 // Handle the request from form. … … 563 563 return EFI_INVALID_PARAMETER; 564 564 } 565 565 566 566 // 567 567 // Judge first 2 bits. … … 666 666 DisplayLoadPermit (); 667 667 break; 668 668 669 669 // 670 670 // Forbid load device path. … … 673 673 DisplayLoadForbid (); 674 674 break; 675 675 676 676 default: 677 677 break; 678 678 } 679 679 break; 680 680 681 681 // 682 682 // Connect device path form. … … 693 693 DisplayConnectPermit (); 694 694 break; 695 695 696 696 // 697 697 // Forbid connect device path. … … 700 700 DisplayConnectForbid (); 701 701 break; 702 702 703 703 default: 704 704 break; … … 837 837 return EFI_SUCCESS; 838 838 } 839 839 840 840 // 841 841 // Initialize driver private data. … … 845 845 846 846 CallbackInfo = AllocateZeroPool (sizeof (USER_PROFILE_MANAGER_CALLBACK_INFO)); 847 ASSERT (CallbackInfo != NULL); 847 ASSERT (CallbackInfo != NULL); 848 848 849 849 CallbackInfo->Signature = USER_PROFILE_MANAGER_SIGNATURE; … … 852 852 CallbackInfo->ConfigAccess.Callback = UserProfileManagerCallback; 853 853 CallbackInfo->DriverHandle = NULL; 854 854 855 855 // 856 856 // Install Device Path Protocol and Config Access protocol to driver handle. … … 876 876 NULL 877 877 ); 878 ASSERT (CallbackInfo->HiiHandle != NULL); 878 ASSERT (CallbackInfo->HiiHandle != NULL); 879 879 mCallbackInfo = CallbackInfo; 880 880 … … 882 882 } 883 883 884 884 -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.h
r58459 r58466 1 1 /** @file 2 2 The header file for user profile manager driver. 3 3 4 4 Copyright (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 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 56 56 UINTN AccessPolicyLen; 57 57 UINTN IdentityPolicyLen; 58 UINTN NewIdentityPolicyLen; 58 UINTN NewIdentityPolicyLen; 59 59 UINT8 *AccessPolicy; 60 60 UINT8 *IdentityPolicy; … … 198 198 Add a username item in form. 199 199 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. 201 201 @param[in] Index The index of the user in the user name list. 202 202 @param[in] OpCodeHandle Points to container for dynamic created opcodes. … … 217 217 218 218 @param[in] UserIndex The index of the user in display list to modify. 219 219 220 220 **/ 221 221 VOID … … 225 225 226 226 /** 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 228 228 database with it. 229 229 … … 254 254 /** 255 255 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, 258 258 the identity policy can be: T, P & P & P & ..., P | P | P | ... 259 259 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. 261 261 262 262 **/ … … 271 271 In this form, access right, access setu,p and access boot order are dynamically 272 272 added. Load devicepath and connect devicepath are displayed too. 273 273 274 274 **/ 275 275 VOID … … 279 279 280 280 /** 281 Collect all the access policy data to mUserInfo.AccessPolicy, 281 Collect all the access policy data to mUserInfo.AccessPolicy, 282 282 and save it to user profile. 283 283 … … 339 339 340 340 /** 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 342 342 list (mAccessInfo.LoadForbid). 343 343 344 344 @param[in] DriverIndex The index of driver in a forbidden device path list. 345 345 346 346 **/ 347 347 VOID … … 349 349 IN UINT16 DriverIndex 350 350 ); 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 354 354 list (mAccessInfo.LoadForbid). 355 355 356 356 @param[in] DriverIndex The index of driver saved in driver options. 357 357 358 358 **/ 359 359 VOID … … 364 364 /** 365 365 Get user name from the popup windows. 366 366 367 367 @param[in, out] UserNameLen On entry, point to the buffer lengh of UserName. 368 368 On exit, point to the input user name length. 369 369 @param[out] UserName The buffer to hold the input user name. 370 370 371 371 @retval EFI_ABORTED It is given up by pressing 'ESC' key. 372 372 @retval EFI_NOT_READY Not a valid input at all. … … 386 386 @param[in] InfoType The user information type to find. 387 387 @param[out] UserInfo Points to user information handle found. 388 388 389 389 @retval EFI_SUCCESS Find the user information successfully. 390 390 @retval Others Fail to find the user information. … … 419 419 @param[in] ValidLen The valid access policy length. 420 420 @param[in] ExpandLen The length that is needed to expand. 421 421 422 422 **/ 423 423 VOID … … 429 429 /** 430 430 Delete User's credental from all the providers that exist in User's identity policy. 431 431 432 432 @param[in] IdentityPolicy Point to User's identity policy. 433 433 @param[in] IdentityPolicyLen The length of the identity policy. … … 439 439 IN UINT8 *IdentityPolicy, 440 440 IN UINTN IdentityPolicyLen, 441 IN EFI_USER_PROFILE_HANDLE User 442 ); 443 441 IN EFI_USER_PROFILE_HANDLE User 442 ); 443 444 444 #endif -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerData.h
r48674 r58466 1 1 /** @file 2 2 The form data for user profile manager driver. 3 3 4 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 48 48 49 49 // 50 // First form key (Add/modify/del user profile). 50 // First form key (Add/modify/del user profile). 51 51 // First 2 bits (bit 16~15). 52 52 // … … 78 78 // Specified key, used in VFR (KEY_MODIFY_USER | KEY_SELECT_USER | KEY_MODIFY_NAME). 79 79 // 80 #define KEY_MODIFY_USER_NAME 0x5200 80 #define KEY_MODIFY_USER_NAME 0x5200 81 81 82 82 // … … 135 135 // Device path modify key. 136 136 // 2 bits (bit 12~11). 137 // 137 // 138 138 #define KEY_LOAD_PERMIT_MODIFY 0x0000 139 139 #define KEY_LOAD_FORBID_MODIFY 0x0400 -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerDxe.inf
r58459 r58466 51 51 UefiLib 52 52 DevicePathLib 53 53 54 54 [Guids] 55 55 gEfiIfrTianoGuid ## SOMETIMES_CONSUMES ## GUID … … 67 67 [Depex] 68 68 gEfiUserManagerProtocolGuid 69 69 70 70 [UserExtensions.TianoCore."ExtraFiles"] 71 71 UserProfileManagerExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerStrings.uni
-
Property svn:mime-type
changed from
application/octet-stream
totext/plain;encoding=UTF-16LE
-
Property svn:mime-type
changed from
-
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerVfr.Vfr
-
Property svn:eol-style
set to
native
r58459 r58466 3 3 4 4 Copyright (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 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 18 18 #define USER_MANAGER_SUBCLASS 0x04 19 19 20 formset 20 formset 21 21 guid = USER_PROFILE_MANAGER_GUID, 22 title = STRING_TOKEN(STR_FORMSET_TITLE), 22 title = STRING_TOKEN(STR_FORMSET_TITLE), 23 23 help = STRING_TOKEN(STR_TITLE_HELP), 24 24 class = USER_MANAGER_CLASS, 25 25 subclass = USER_MANAGER_SUBCLASS, 26 26 27 27 // User manager form 28 28 form formid = FORMID_USER_MANAGE, … … 39 39 key = QUESTIONID_USER_MANAGE; 40 40 endif; 41 42 endform; 43 41 42 endform; 43 44 44 // Modify user profile form 45 45 form formid = FORMID_MODIFY_USER, … … 50 50 51 51 endform; 52 52 53 53 // Delete user profile form 54 54 form formid = FORMID_DEL_USER, 55 55 title = STRING_TOKEN(STR_DELETE_USER_TITLE); 56 56 57 57 label LABEL_USER_DEL_FUNC; 58 58 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 64 64 // 65 65 // User profile information form … … 68 68 title = STRING_TOKEN(STR_USER_INFO); 69 69 70 text 71 help = STRING_TOKEN(STR_USER_NAME_VAL), 70 text 71 help = STRING_TOKEN(STR_USER_NAME_VAL), 72 72 text = STRING_TOKEN(STR_USER_NAME), 73 73 flags = INTERACTIVE, 74 74 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), 78 78 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), 82 82 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), 86 86 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 93 93 // 94 94 // Identify policy modify form … … 97 97 title = STRING_TOKEN(STR_IDENTIFY_POLICY); 98 98 99 text 99 text 100 100 help = STRING_TOKEN(STR_IDENTIFY_POLICY_HELP), 101 101 text = STRING_TOKEN(STR_IDENTIFY_POLICY), 102 102 text = STRING_TOKEN(STR_IDENTIFY_POLICY_VALUE); 103 103 104 104 label LABEL_IP_MOD_FUNC; 105 105 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), 109 109 text = STRING_TOKEN(STR_ADD_OPTION), 110 110 flags = INTERACTIVE, 111 111 key = KEY_ADD_LOGICAL_OP; 112 113 subtitle 112 113 subtitle 114 114 text = STRING_TOKEN(STR_NULL_STRING); 115 115 … … 121 121 122 122 endform; 123 123 124 124 // 125 125 // Access policy modify form … … 143 143 key = KEY_CONN_DP; 144 144 145 subtitle 146 text = STRING_TOKEN(STR_NULL_STRING); 147 145 subtitle 146 text = STRING_TOKEN(STR_NULL_STRING); 147 148 148 text 149 149 help = STRING_TOKEN(STR_ACCESS_SAVE_HELP), … … 165 165 flags = INTERACTIVE, 166 166 key = KEY_LOAD_PERMIT; 167 167 168 168 goto FORMID_FORBID_LOAD_DP, 169 169 prompt = STRING_TOKEN(STR_LOAD_FORBID), … … 171 171 flags = INTERACTIVE, 172 172 key = KEY_LOAD_FORBID; 173 174 endform; 175 173 174 endform; 175 176 176 // 177 177 // Permit load device path form … … 179 179 form formid = FORMID_PERMIT_LOAD_DP, 180 180 title = STRING_TOKEN(STR_LOAD_PERMIT); 181 181 182 182 label LABEL_PERMIT_LOAD_FUNC; 183 183 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 190 190 // 191 191 // Forbid load device path form … … 193 193 form formid = FORMID_FORBID_LOAD_DP, 194 194 title = STRING_TOKEN(STR_LOAD_FORBID); 195 195 196 196 label LABLE_FORBID_LOAD_FUNC; 197 197 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 204 204 // 205 205 // Connect device path form … … 213 213 flags = INTERACTIVE, 214 214 key = KEY_CONNECT_PERMIT; 215 215 216 216 goto FORMID_FORBID_CONNECT_DP, 217 217 prompt = STRING_TOKEN(STR_CONNECT_FORBID), … … 219 219 flags = INTERACTIVE, 220 220 key = KEY_CONNECT_FORBID; 221 222 endform; 223 221 222 endform; 223 224 224 // 225 225 // Permit connect device path form … … 227 227 form formid = FORMID_PERMIT_CONNECT_DP, 228 228 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 235 235 // 236 236 // Forbid connect device path form … … 238 238 form formid = FORMID_FORBID_CONNECT_DP, 239 239 title = STRING_TOKEN(STR_CONNECT_FORBID); 240 241 subtitle 240 241 subtitle 242 242 text = STRING_TOKEN(STR_NULL_STRING); 243 243 244 244 endform; 245 245 246 246 endformset; -
Property svn:eol-style
set to
-
trunk/src/VBox/Devices/EFI/Firmware/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileModify.c
r48674 r58466 1 1 /** @file 2 2 The functions to modify a user profile. 3 3 4 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 … … 128 128 mUserInfo.UsageDateExist = FALSE; 129 129 mUserInfo.UsageCount = 0; 130 130 131 131 mUserInfo.AccessPolicyLen = 0; 132 132 mUserInfo.AccessPolicyModified = FALSE; … … 141 141 mUserInfo.IdentityPolicy = NULL; 142 142 } 143 143 144 144 // 145 145 // Allocate user information memory. … … 150 150 return ; 151 151 } 152 152 153 153 // 154 154 // Get each user information. … … 165 165 InfoSize = MemSize; 166 166 Status = mUserManager->GetInfo ( 167 mUserManager, 168 mModifyUser, 169 UserInfo, 170 Info, 167 mUserManager, 168 mModifyUser, 169 UserInfo, 170 Info, 171 171 &InfoSize 172 172 ); … … 282 282 Str + StrLen (Str), 283 283 DateBufLen, 284 L"%2d:%2d:%2d", 284 L"%2d:%2d:%2d", 285 285 Date->Hour, 286 286 Date->Minute, 287 287 Date->Second 288 288 ); 289 289 290 290 HiiSetString (mCallbackInfo->HiiHandle, DateId, Str, NULL); 291 291 FreePool (Str); … … 309 309 CHAR16 Count[10]; 310 310 311 UnicodeSPrint (Count, 20, L"%d", CountVal); 311 UnicodeSPrint (Count, 20, L"%d", CountVal); 312 312 HiiSetString (mCallbackInfo->HiiHandle, CountId, Count, NULL); 313 313 } … … 319 319 320 320 @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 322 322 @param[in] Source2 Pointer to a Null-terminated Unicode string. 323 323 … … 381 381 EFI_HII_HANDLE HiiHandle; 382 382 EFI_USER_CREDENTIAL2_PROTOCOL *UserCredential; 383 383 384 384 TmpStr = NULL; 385 385 386 386 // 387 387 // Resolve each policy. … … 414 414 for (Index = 0; Index < mProviderInfo->Count; Index++) { 415 415 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)) { 436 417 UserCredential->Title ( 437 418 UserCredential, … … 448 429 } 449 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)) { 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; 450 450 } 451 451 … … 467 467 468 468 @param[in] UserIndex The index of the user in display list to modify. 469 469 470 470 **/ 471 471 VOID … … 528 528 UserIndex--; 529 529 } 530 530 531 531 // 532 532 // Get user profile information. … … 542 542 NULL 543 543 ); 544 544 545 545 // 546 546 // Update create date. … … 556 556 ); 557 557 } 558 558 559 559 // 560 560 // Add usage date. … … 570 570 ); 571 571 } 572 572 573 573 // 574 574 // Add usage count. 575 575 // 576 576 ResolveCount ((UINT32) mUserInfo.UsageCount, STRING_TOKEN (STR_USAGE_COUNT_VAL)); 577 577 578 578 // 579 579 // Add identity policy. … … 595 595 ); 596 596 } 597 597 598 598 // 599 599 // Add access policy. … … 644 644 645 645 // 646 // Set default value 646 // Set default value 647 647 // 648 648 mAccessInfo.AccessRight = EFI_USER_INFO_ACCESS_ENROLL_SELF; … … 654 654 mAccessInfo.ConnectPermitLen = 0; 655 655 mAccessInfo.ConnectForbidLen = 0; 656 656 657 657 // 658 658 // Get each user access policy. … … 660 660 OffSet = 0; 661 661 while (OffSet < mUserInfo.AccessPolicyLen) { 662 CopyMem (&Control, mUserInfo.AccessPolicy + OffSet, sizeof (Control)); 662 CopyMem (&Control, mUserInfo.AccessPolicy + OffSet, sizeof (Control)); 663 663 ValLen = Control.Size - sizeof (Control); 664 664 switch (Control.Type) { … … 755 755 @param[in] InfoType The user information type to find. 756 756 @param[out] UserInfo Points to user information handle found. 757 757 758 758 @retval EFI_SUCCESS Find the user information successfully. 759 759 @retval Others Fail to find the user information. … … 785 785 return EFI_OUT_OF_RESOURCES; 786 786 } 787 787 788 788 // 789 789 // Get each user information. … … 837 837 In this form, access right, access setup and access boot order are dynamically 838 838 added. Load devicepath and connect devicepath are displayed too. 839 839 840 840 **/ 841 841 VOID … … 850 850 EFI_IFR_GUID_LABEL *EndLabel; 851 851 VOID *DefaultOpCodeHandle; 852 852 853 853 // 854 854 // Initialize the container for dynamic opcodes. … … 894 894 DefaultOpCodeHandle = HiiAllocateOpCodeHandle (); 895 895 ASSERT (DefaultOpCodeHandle != NULL); 896 896 897 897 HiiCreateOneOfOptionOpCode ( 898 898 OptionsOpCodeHandle, … … 920 920 921 921 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, 925 925 mAccessInfo.AccessRight 926 926 ); 927 927 928 928 HiiCreateOneOfOpCode ( 929 929 StartOpCodeHandle, // Container for dynamic created opcodes … … 949 949 DefaultOpCodeHandle = HiiAllocateOpCodeHandle (); 950 950 ASSERT (DefaultOpCodeHandle != NULL); 951 951 952 952 HiiCreateOneOfOptionOpCode ( 953 953 OptionsOpCodeHandle, … … 957 957 ACCESS_SETUP_RESTRICTED 958 958 ); 959 959 960 960 HiiCreateOneOfOptionOpCode ( 961 961 OptionsOpCodeHandle, … … 975 975 976 976 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, 980 980 mAccessInfo.AccessSetup 981 ); 981 ); 982 982 983 983 HiiCreateOneOfOpCode ( … … 995 995 HiiFreeOpCodeHandle (DefaultOpCodeHandle); 996 996 HiiFreeOpCodeHandle (OptionsOpCodeHandle); 997 997 998 998 // 999 999 // Add boot order one-of-code. … … 1003 1003 DefaultOpCodeHandle = HiiAllocateOpCodeHandle (); 1004 1004 ASSERT (DefaultOpCodeHandle != NULL); 1005 1005 1006 1006 HiiCreateOneOfOptionOpCode ( 1007 1007 OptionsOpCodeHandle, … … 1027 1027 EFI_USER_INFO_ACCESS_BOOT_ORDER_REPLACE 1028 1028 ); 1029 1029 1030 1030 HiiCreateOneOfOptionOpCode ( 1031 1031 OptionsOpCodeHandle, … … 1037 1037 1038 1038 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, 1042 1042 mAccessInfo.AccessBootOrder 1043 1043 ); 1044 1044 1045 1045 HiiCreateOneOfOpCode ( 1046 1046 StartOpCodeHandle, // Container for dynamic created opcodes … … 1055 1055 DefaultOpCodeHandle // Default Opcode 1056 1056 ); 1057 HiiFreeOpCodeHandle (DefaultOpCodeHandle); 1057 HiiFreeOpCodeHandle (DefaultOpCodeHandle); 1058 1058 HiiFreeOpCodeHandle (OptionsOpCodeHandle); 1059 1059 … … 1079 1079 @param[in] ValidLen The valid access policy length. 1080 1080 @param[in] ExpandLen The length that is needed to expand. 1081 1081 1082 1082 **/ 1083 1083 VOID … … 1108 1108 1109 1109 /** 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 1111 1111 database with it. 1112 1112 … … 1143 1143 return ; 1144 1144 } 1145 1145 1146 1146 // 1147 1147 // Check whether the username had been used or not. … … 1179 1179 return ; 1180 1180 } 1181 1181 1182 1182 // 1183 1183 // Update username display in the form. … … 1185 1185 CopyMem (mUserInfo.UserName, UserName, Len); 1186 1186 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, 1190 1190 NULL 1191 1191 ); … … 1304 1304 HiiFreeOpCodeHandle (OptionsOpCodeHandle); 1305 1305 } 1306 1306 1307 1307 // 1308 1308 // Add logical connector Option OpCode. … … 1346 1346 // 1347 1347 ResolveIdentityPolicy ( 1348 mUserInfo.IdentityPolicy, 1349 mUserInfo.IdentityPolicyLen, 1348 mUserInfo.IdentityPolicy, 1349 mUserInfo.IdentityPolicyLen, 1350 1350 STRING_TOKEN (STR_IDENTIFY_POLICY_VALUE) 1351 1351 ); … … 1405 1405 return EFI_OUT_OF_RESOURCES; 1406 1406 } 1407 1407 1408 1408 // 1409 1409 // Get user access information. … … 1446 1446 break; 1447 1447 } 1448 1448 1449 1449 // 1450 1450 // Check user information.
Note:
See TracChangeset
for help on using the changeset viewer.