Skip to content

MsvmPkg: add DisableSha1Pcr config flag to mask SHA-1 from TPM PCRs - #99

Open
Mike Ebersol (mebersol) wants to merge 1 commit into
microsoft:mainfrom
mebersol:feature/disable-sha1-pcd
Open

MsvmPkg: add DisableSha1Pcr config flag to mask SHA-1 from TPM PCRs#99
Mike Ebersol (mebersol) wants to merge 1 commit into
microsoft:mainfrom
mebersol:feature/disable-sha1-pcd

Conversation

@mebersol

@mebersol Mike Ebersol (mebersol) commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a DisableSha1Pcr UEFI config flag that, when set by the host, removes the SHA-1 bank from the TPM PCR hash mask (PcdTpm2HashMask) at PEI time.

This follows the existing DisableSha384Pcr pattern.

Changes

  • MsvmPkg/Include/BiosInterface.h — repurpose the previously reserved HvSintEnabled bit in UEFI_CONFIG_FLAGS as DisableSha1Pcr. No new bit is consumed and Reserved is unchanged, so the surrounding flag layout/ABI is preserved.
  • MsvmPkg/PlatformPei/Config.c — in ConfigSetUefiConfigFlags, when the flag is set, clear HASH_ALG_SHA1 from PcdTpm2HashMask via PcdSet32S (same MDE_CPU_X64 guard as the SHA-384 path); plus a matching DEBUG_VERBOSE log line.

The dynamic PCD gEfiSecurityPkgTokenSpaceGuid.PcdTpm2HashMask is already declared in PlatformPei.inf, so no INF/DSC changes are required.

Notes

Default behavior is unchanged (flag defaults to 0). Effective only on X64, matching the existing SHA-384 measured-boot config path.

Add a DisableSha1Pcr UEFI config flag that, when set by the host, clears the SHA-1 bank from PcdTpm2HashMask at PEI time. Follows the existing DisableSha384Pcr pattern.
@maheeraeron

Copy link
Copy Markdown
Collaborator

Should we not just remove all instances of SecurityPkg/Library/HashInstanceLibSha1/HashInstanceLibSha1.inf in our .dsc files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants