Changeset 105670 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/SecurityPkg/VariableAuthenticated
- Timestamp:
- Aug 14, 2024 1:16:30 PM (6 months ago)
- svn:sync-xref-src-repo-rev:
- 164367
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-159268 /vendor/edk2/current 103735-103757,103769-103776,129194-164365
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
r99404 r105670 83 83 gEfiCertSha256Guid 84 84 85 ## SOMETIMES_CONSUMES ## GUID # Unique ID for the type of the signature. 86 ## SOMETIMES_PRODUCES ## GUID # Unique ID for the type of the signature. 87 gEfiCertSha384Guid 88 89 ## SOMETIMES_CONSUMES ## GUID # Unique ID for the type of the signature. 90 ## SOMETIMES_PRODUCES ## GUID # Unique ID for the type of the signature. 91 gEfiCertSha512Guid 92 85 93 ## SOMETIMES_CONSUMES ## Variable:L"db" 86 94 ## SOMETIMES_PRODUCES ## Variable:L"db" -
trunk/src/VBox/Devices/EFI/FirmwareNew/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
r101291 r105670 1848 1848 Status = FALSE; 1849 1849 1850 if ( HashAlg != HASHALG_SHA256) {1850 if ((HashAlg >= HASHALG_MAX)) { 1851 1851 return FALSE; 1852 1852 } … … 1857 1857 ZeroMem (mImageDigest, MAX_DIGEST_SIZE); 1858 1858 1859 mImageDigestSize = SHA256_DIGEST_SIZE; 1860 mCertType = gEfiCertSha256Guid; 1859 switch (HashAlg) { 1860 case HASHALG_SHA256: 1861 mImageDigestSize = SHA256_DIGEST_SIZE; 1862 mCertType = gEfiCertSha256Guid; 1863 break; 1864 1865 case HASHALG_SHA384: 1866 mImageDigestSize = SHA384_DIGEST_SIZE; 1867 mCertType = gEfiCertSha384Guid; 1868 break; 1869 1870 case HASHALG_SHA512: 1871 mImageDigestSize = SHA512_DIGEST_SIZE; 1872 mCertType = gEfiCertSha512Guid; 1873 break; 1874 1875 default: 1876 return FALSE; 1877 } 1861 1878 1862 1879 CtxSize = mHash[HashAlg].GetContextSize (); … … 2252 2269 WIN_CERTIFICATE_UEFI_GUID *GuidCertData; 2253 2270 EFI_TIME Time; 2271 UINT32 HashAlg; 2254 2272 2255 2273 Data = NULL; … … 2290 2308 2291 2309 if (mSecDataDir->SizeOfCert == 0) { 2292 if (!HashPeImage (HASHALG_SHA256)) { 2293 Status = EFI_SECURITY_VIOLATION; 2310 Status = EFI_SECURITY_VIOLATION; 2311 HashAlg = sizeof (mHash) / sizeof (HASH_TABLE); 2312 while (HashAlg > 0) { 2313 HashAlg--; 2314 if ((mHash[HashAlg].GetContextSize == NULL) || (mHash[HashAlg].HashInit == NULL) || (mHash[HashAlg].HashUpdate == NULL) || (mHash[HashAlg].HashFinal == NULL)) { 2315 continue; 2316 } 2317 2318 if (HashPeImage (HashAlg)) { 2319 Status = EFI_SUCCESS; 2320 break; 2321 } 2322 } 2323 2324 if (EFI_ERROR (Status)) { 2325 DEBUG ((DEBUG_ERROR, "Fail to get hash digest: %r", Status)); 2294 2326 goto ON_EXIT; 2295 2327 } … … 3335 3367 } 3336 3368 3369 ConfigData->ListCount = Private->ListCount; 3370 3337 3371 // 3338 3372 // If it is Physical Presence User, set the PhysicalPresent to true. … … 3765 3799 } else if (CompareGuid (&ListWalker->SignatureType, &gEfiCertSha256Guid)) { 3766 3800 ListType = STRING_TOKEN (STR_LIST_TYPE_SHA256); 3801 } else if (CompareGuid (&ListWalker->SignatureType, &gEfiCertSha384Guid)) { 3802 ListType = STRING_TOKEN (STR_LIST_TYPE_SHA384); 3803 } else if (CompareGuid (&ListWalker->SignatureType, &gEfiCertSha512Guid)) { 3804 ListType = STRING_TOKEN (STR_LIST_TYPE_SHA512); 3767 3805 } else if (CompareGuid (&ListWalker->SignatureType, &gEfiCertX509Sha256Guid)) { 3768 3806 ListType = STRING_TOKEN (STR_LIST_TYPE_X509_SHA256); … … 4012 4050 ListTypeId = STRING_TOKEN (STR_LIST_TYPE_SHA256); 4013 4051 DataSize = 32; 4052 } else if (CompareGuid (&ListEntry->SignatureType, &gEfiCertSha384Guid)) { 4053 ListTypeId = STRING_TOKEN (STR_LIST_TYPE_SHA384); 4054 DataSize = 48; 4055 } else if (CompareGuid (&ListEntry->SignatureType, &gEfiCertSha512Guid)) { 4056 ListTypeId = STRING_TOKEN (STR_LIST_TYPE_SHA512); 4057 DataSize = 64; 4014 4058 } else if (CompareGuid (&ListEntry->SignatureType, &gEfiCertX509Sha256Guid)) { 4015 4059 ListTypeId = STRING_TOKEN (STR_LIST_TYPE_X509_SHA256); … … 4500 4544 EFI_HII_POPUP_SELECTION UserSelection; 4501 4545 4502 Status = EFI_SUCCESS; 4503 SecureBootEnable = NULL; 4504 SecureBootMode = NULL; 4505 SetupMode = NULL; 4506 File = NULL; 4507 EnrollKeyErrorCode = None_Error; 4546 Status = EFI_SUCCESS; 4547 SecureBootEnable = NULL; 4548 SecureBootMode = NULL; 4549 SetupMode = NULL; 4550 File = NULL; 4551 EnrollKeyErrorCode = None_Error; 4552 GetBrowserDataResult = FALSE; 4508 4553 4509 4554 if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) { … … 4523 4568 return EFI_OUT_OF_RESOURCES; 4524 4569 } 4525 4526 GetBrowserDataResult = HiiGetBrowserData (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, (UINT8 *)IfrNvData);4527 4570 4528 4571 if (Action == EFI_BROWSER_ACTION_FORM_OPEN) { … … 4531 4574 // Update secure boot strings when opening this form 4532 4575 // 4533 Status = UpdateSecureBootString (Private); 4534 SecureBootExtractConfigFromVariable (Private, IfrNvData); 4576 Status = UpdateSecureBootString (Private); 4535 4577 mIsEnterSecureBootForm = TRUE; 4536 4578 } else { … … 4546 4588 { 4547 4589 CloseEnrolledFile (Private->FileContext); 4548 } else if (QuestionId == KEY_SECURE_BOOT_DELETE_ALL_LIST) {4549 //4550 // Update ListCount field in varstore4551 // Button "Delete All Signature List" is4552 // enable when ListCount is greater than 0.4553 //4554 IfrNvData->ListCount = Private->ListCount;4555 4590 } 4556 4591 } … … 4558 4593 goto EXIT; 4559 4594 } 4595 4596 GetBrowserDataResult = HiiGetBrowserData (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, (UINT8 *)IfrNvData); 4560 4597 4561 4598 if (Action == EFI_BROWSER_ACTION_RETRIEVE) { … … 4563 4600 if (QuestionId == KEY_SECURE_BOOT_MODE) { 4564 4601 if (mIsEnterSecureBootForm) { 4602 if (GetBrowserDataResult) { 4603 SecureBootExtractConfigFromVariable (Private, IfrNvData); 4604 } 4605 4565 4606 Value->u8 = SECURE_BOOT_MODE_STANDARD; 4566 4607 Status = EFI_SUCCESS; … … 4723 4764 NULL 4724 4765 ); 4766 } else { 4767 SecureBootExtractConfigFromVariable (Private, IfrNvData); 4725 4768 } 4726 4769 } … … 4786 4829 OPTION_SIGNATURE_LIST_QUESTION_ID 4787 4830 ); 4831 IfrNvData->ListCount = Private->ListCount; 4788 4832 break; 4789 4833 … … 4810 4854 OPTION_SIGNATURE_LIST_QUESTION_ID 4811 4855 ); 4856 IfrNvData->ListCount = Private->ListCount; 4812 4857 break; 4813 4858 … … 4834 4879 OPTION_SIGNATURE_LIST_QUESTION_ID 4835 4880 ); 4881 IfrNvData->ListCount = Private->ListCount; 4836 4882 break; 4837 4883 … … 4913 4959 NULL 4914 4960 ); 4961 } else { 4962 IfrNvData->ListCount = Private->ListCount; 4915 4963 } 4916 4964 … … 4964 5012 NULL 4965 5013 ); 5014 } else { 5015 SecureBootExtractConfigFromVariable (Private, IfrNvData); 4966 5016 } 4967 5017 -
trunk/src/VBox/Devices/EFI/FirmwareNew/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
r99404 r105670 83 83 84 84 #define WIN_CERT_UEFI_RSA2048_SIZE 256 85 #define WIN_CERT_UEFI_RSA3072_SIZE 384 86 #define WIN_CERT_UEFI_RSA4096_SIZE 512 85 87 86 88 // … … 98 100 // 99 101 #define CER_PUBKEY_MIN_SIZE 256 102 103 // 104 // Define KeyType for public key storing file 105 // 106 #define KEY_TYPE_RSASSA 0 100 107 101 108 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigStrings.uni
r99404 r105670 125 125 #string STR_LIST_TYPE_SHA1 #language en-US "SHA1" 126 126 #string STR_LIST_TYPE_SHA256 #language en-US "SHA256" 127 #string STR_LIST_TYPE_SHA384 #language en-US "SHA384" 128 #string STR_LIST_TYPE_SHA512 #language en-US "SHA512" 127 129 #string STR_LIST_TYPE_X509_SHA256 #language en-US "X509_SHA256" 128 130 #string STR_LIST_TYPE_X509_SHA384 #language en-US "X509_SHA384"
Note:
See TracChangeset
for help on using the changeset viewer.