SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is not Tdx guest

HashLibTdx is designed for the Tdx guest. So if is not a Tdx guest,
return EFI_UNSUPPORTED in RegisterHashInterfaceLib.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Min M Xu 2022-06-12 19:24:34 +08:00 committed by mergify[bot]
parent 16d97fa601
commit 05e57cc9ce
1 changed files with 7 additions and 1 deletions

View File

@ -186,7 +186,13 @@ RegisterHashInterfaceLib (
IN HASH_INTERFACE *HashInterface
)
{
ASSERT (TdIsEnabled ());
//
// HashLibTdx is designed for Tdx guest. So if it is not Tdx guest,
// return EFI_UNSUPPORTED.
//
if (!TdIsEnabled ()) {
return EFI_UNSUPPORTED;
}
//
// Only SHA384 is allowed.