VirtualBox

Ignore:
Timestamp:
Aug 14, 2024 1:16:30 PM (6 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164367
Message:

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
5 edited

Legend:

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

  • trunk/src/VBox/Devices/EFI/FirmwareNew/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf

    r99404 r105670  
    8383  gEfiCertSha256Guid
    8484
     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
    8593  ## SOMETIMES_CONSUMES      ## Variable:L"db"
    8694  ## SOMETIMES_PRODUCES      ## Variable:L"db"
  • trunk/src/VBox/Devices/EFI/FirmwareNew/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c

    r101291 r105670  
    18481848  Status        = FALSE;
    18491849
    1850   if (HashAlg != HASHALG_SHA256) {
     1850  if ((HashAlg >= HASHALG_MAX)) {
    18511851    return FALSE;
    18521852  }
     
    18571857  ZeroMem (mImageDigest, MAX_DIGEST_SIZE);
    18581858
    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  }
    18611878
    18621879  CtxSize = mHash[HashAlg].GetContextSize ();
     
    22522269  WIN_CERTIFICATE_UEFI_GUID  *GuidCertData;
    22532270  EFI_TIME                   Time;
     2271  UINT32                     HashAlg;
    22542272
    22552273  Data         = NULL;
     
    22902308
    22912309  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));
    22942326      goto ON_EXIT;
    22952327    }
     
    33353367  }
    33363368
     3369  ConfigData->ListCount = Private->ListCount;
     3370
    33373371  //
    33383372  // If it is Physical Presence User, set the PhysicalPresent to true.
     
    37653799    } else if (CompareGuid (&ListWalker->SignatureType, &gEfiCertSha256Guid)) {
    37663800      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);
    37673805    } else if (CompareGuid (&ListWalker->SignatureType, &gEfiCertX509Sha256Guid)) {
    37683806      ListType = STRING_TOKEN (STR_LIST_TYPE_X509_SHA256);
     
    40124050    ListTypeId = STRING_TOKEN (STR_LIST_TYPE_SHA256);
    40134051    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;
    40144058  } else if (CompareGuid (&ListEntry->SignatureType, &gEfiCertX509Sha256Guid)) {
    40154059    ListTypeId = STRING_TOKEN (STR_LIST_TYPE_X509_SHA256);
     
    45004544  EFI_HII_POPUP_SELECTION         UserSelection;
    45014545
    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;
    45084553
    45094554  if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {
     
    45234568    return EFI_OUT_OF_RESOURCES;
    45244569  }
    4525 
    4526   GetBrowserDataResult = HiiGetBrowserData (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, (UINT8 *)IfrNvData);
    45274570
    45284571  if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
     
    45314574      // Update secure boot strings when opening this form
    45324575      //
    4533       Status = UpdateSecureBootString (Private);
    4534       SecureBootExtractConfigFromVariable (Private, IfrNvData);
     4576      Status                 = UpdateSecureBootString (Private);
    45354577      mIsEnterSecureBootForm = TRUE;
    45364578    } else {
     
    45464588      {
    45474589        CloseEnrolledFile (Private->FileContext);
    4548       } else if (QuestionId == KEY_SECURE_BOOT_DELETE_ALL_LIST) {
    4549         //
    4550         // Update ListCount field in varstore
    4551         // Button "Delete All Signature List" is
    4552         // enable when ListCount is greater than 0.
    4553         //
    4554         IfrNvData->ListCount = Private->ListCount;
    45554590      }
    45564591    }
     
    45584593    goto EXIT;
    45594594  }
     4595
     4596  GetBrowserDataResult = HiiGetBrowserData (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, (UINT8 *)IfrNvData);
    45604597
    45614598  if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
     
    45634600    if (QuestionId == KEY_SECURE_BOOT_MODE) {
    45644601      if (mIsEnterSecureBootForm) {
     4602        if (GetBrowserDataResult) {
     4603          SecureBootExtractConfigFromVariable (Private, IfrNvData);
     4604        }
     4605
    45654606        Value->u8 = SECURE_BOOT_MODE_STANDARD;
    45664607        Status    = EFI_SUCCESS;
     
    47234764                NULL
    47244765                );
     4766            } else {
     4767              SecureBootExtractConfigFromVariable (Private, IfrNvData);
    47254768            }
    47264769          }
     
    47864829          OPTION_SIGNATURE_LIST_QUESTION_ID
    47874830          );
     4831        IfrNvData->ListCount = Private->ListCount;
    47884832        break;
    47894833
     
    48104854          OPTION_SIGNATURE_LIST_QUESTION_ID
    48114855          );
     4856        IfrNvData->ListCount = Private->ListCount;
    48124857        break;
    48134858
     
    48344879          OPTION_SIGNATURE_LIST_QUESTION_ID
    48354880          );
     4881        IfrNvData->ListCount = Private->ListCount;
    48364882        break;
    48374883
     
    49134959            NULL
    49144960            );
     4961        } else {
     4962          IfrNvData->ListCount = Private->ListCount;
    49154963        }
    49164964
     
    49645012            NULL
    49655013            );
     5014        } else {
     5015          SecureBootExtractConfigFromVariable (Private, IfrNvData);
    49665016        }
    49675017
  • trunk/src/VBox/Devices/EFI/FirmwareNew/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h

    r99404 r105670  
    8383
    8484#define WIN_CERT_UEFI_RSA2048_SIZE  256
     85#define WIN_CERT_UEFI_RSA3072_SIZE  384
     86#define WIN_CERT_UEFI_RSA4096_SIZE  512
    8587
    8688//
     
    98100//
    99101#define CER_PUBKEY_MIN_SIZE  256
     102
     103//
     104// Define KeyType for public key storing file
     105//
     106#define KEY_TYPE_RSASSA  0
    100107
    101108//
  • trunk/src/VBox/Devices/EFI/FirmwareNew/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigStrings.uni

    r99404 r105670  
    125125#string STR_LIST_TYPE_SHA1                        #language en-US "SHA1"
    126126#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"
    127129#string STR_LIST_TYPE_X509_SHA256                 #language en-US "X509_SHA256"
    128130#string STR_LIST_TYPE_X509_SHA384                 #language en-US "X509_SHA384"
Note: See TracChangeset for help on using the changeset viewer.

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