CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with TPM 2.0 Implementation

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2511

This commit aligns the baseHashApiLib with TPM 2.0 Implementation
as follows:
- Remove reference to MD4 and MD5 algorithms as they are deprecated
- Align the enumerations for hashing algoerithms with the one used
  in TPM 2.0 implementation defined in IndustryStandard/Tpm20.h.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Amol N Sukerkar <amol.n.sukerkar@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
Amol N Sukerkar
2020-02-16 03:51:02 +00:00
committed by mergify[bot]
parent 0997352ddb
commit c70bdf9d4a
4 changed files with 51 additions and 114 deletions

View File

@@ -74,16 +74,14 @@
# Based on the value set, the required algorithm is chosen to calculate
# the hash of data.<BR>
# The default hashing algorithm for BaseHashApiLib is set to SHA256.<BR>
# 0x00000001 - MD4.<BR>
# 0x00000002 - MD5.<BR>
# 0x00000003 - SHA1.<BR>
# 0x00000004 - SHA256.<BR>
# 0x00000005 - SHA384.<BR>
# 0x00000006 - SHA512.<BR>
# 0x00000007 - SM3_256.<BR>
# 0x00000001 - HASH_ALG_SHA1.<BR>
# 0x00000002 - HASH_ALG_SHA256.<BR>
# 0x00000004 - HASH_ALG_SHA384.<BR>
# 0x00000008 - HASH_ALG_SHA512.<BR>
# 0x00000010 - HASH_ALG_SM3_256.<BR>
# @Prompt Set policy for hashing unsigned image for Secure Boot.
# @ValidRange 0x80000001 | 0x00000001 - 0x00000007
gEfiCryptoPkgTokenSpaceGuid.PcdHashApiLibPolicy|0x04|UINT8|0x00000001
# @ValidList 0x80000001 | 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010
gEfiCryptoPkgTokenSpaceGuid.PcdHashApiLibPolicy|0x00000002|UINT32|0x00000001
[UserExtensions.TianoCore."ExtraFiles"]
CryptoPkgExtra.uni