edk2/SecurityPkg
Doug Flick 025ab811fb SecurityPkg: Improving SecureBootConfigImpl:HashPeImageByType () logic
Namely:

(1) The TWO_BYTE_ENCODE check is independent of Index. If it evalutes
    to TRUE for Index==0, then it will evaluate to TRUE for all other
    Index values as well. As a result, the (Index == HASHALG_MAX)
    condition will fire after the loop, and we'll return
    EFI_UNSUPPORTED.

    While this is correct, functionally speaking, it is wasteful to
    keep re-checking TWO_BYTE_ENCODE in the loop body. The check
    should be made at the top of the function, and EFI_UNSUPPORTED
    should be returned at once, if appropriate.

(2) If the hash algorithm selected by Index has such a large OID that
    the OID comparison cannot even be performed (because AuthDataSize
    is not large enough for containing the OID in question, starting
    at offset 32), then the function returns EFI_UNSUPPORTED at once.

    This is bogus; this case should simply be treated as an OID
    mismatch, and the loop should advance to the next Index value /
    hash algorithm candidate. A remaining hash algo may have a shorter
    OID and yield an OID match.

Signed-off-by: Doug Flick <DougFlick@microsoft.com>
2025-04-09 00:13:21 +00:00
..
DeviceSecurity SecurityPkg: Update libspdm 2024-11-26 02:15:06 +00:00
EnrollFromDefaultKeysApp SecurityPkg: Secure Boot Drivers: Added common header files 2022-07-07 01:07:00 +00:00
FvReportPei SecurityPkg: Optimization by moving PeiServicesLocatePpi outside loop 2024-09-03 05:02:41 +00:00
Hash2DxeCrypto SecurityPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
HddPassword Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy 2023-05-08 11:39:32 +00:00
Include SecurityPkg/Ppi: Add gEdkiiCcPpi for CC Measurement in PEI phase 2024-12-10 02:09:29 +00:00
Library SecurityPkg: Improving HashPeImageByType () logic 2025-04-09 00:13:21 +00:00
Pkcs7Verify/Pkcs7VerifyDxe SecurityPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
RandomNumberGenerator SecurityPkg: Add RngPei 2025-02-06 20:29:15 +00:00
Tcg SecurityPkg/OpalPassword: fix HiiOpCodeHandle leak on error path 2024-12-06 17:13:17 +00:00
Test SecurityPkg: DxeTpmMeasureBootLib: SECURITY PATCH 4117 - CVE 2022-36763 2024-01-16 07:56:38 +00:00
VariableAuthenticated SecurityPkg: Improving SecureBootConfigImpl:HashPeImageByType () logic 2025-04-09 00:13:21 +00:00
SecurityFixes.yaml SecurityPkg: : Updating SecurityFixes.yaml after symbol rename 2024-01-18 19:25:14 +00:00
SecurityPkg.ci.yaml SecurityPkg/Tpm2DeviceLibDTpm: Add TPM2 lib supporting SVSM vTPM 2025-03-16 20:21:44 +01:00
SecurityPkg.dec SecurityPkg/Tpm2DeviceLibDTpm: Add TPM2 lib supporting SVSM vTPM 2025-03-16 20:21:44 +01:00
SecurityPkg.dsc SecurityPkg: Add TpmMeasurementLib for SEC phase 2025-03-20 02:37:31 +00:00
SecurityPkg.uni SecurityPkg: SubClassTpm: Updated default value 2023-06-23 16:28:24 +00:00
SecurityPkgExtra.uni SecurityPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:23 -07:00