SecurityPkg: add TIS sanity check (tpm12)

The code blindly assumes a TIS interface is present in case both CRB and
FIFO checks fail.  Check the InterfaceType for TIS instead and only
return PtpInterfaceTis in case it matches, PtpInterfaceMax otherwise.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Gerd Hoffmann 2023-04-27 00:24:05 +08:00 committed by mergify[bot]
parent 832fbc6e32
commit d6b42ed7ed
1 changed files with 5 additions and 1 deletions

View File

@ -91,7 +91,11 @@ Tpm12GetPtpInterface (
return PtpInterfaceFifo;
}
return PtpInterfaceTis;
if (InterfaceId.Bits.InterfaceType == PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_TIS) {
return PtpInterfaceTis;
}
return PtpInterfaceMax;
}
/**