diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2023-04-27 00:24:04 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-05-02 15:43:32 +0000 |
commit | 832fbc6e32012fe29f1a6c67ddc90facb43ebeee (patch) | |
tree | 8e8d9824b1452fa5ff362e438ec03f0399bbda63 /SecurityPkg | |
parent | 23c71536efbebed57942947668f470f934324477 (diff) | |
download | edk2-832fbc6e32012fe29f1a6c67ddc90facb43ebeee.tar.gz edk2-832fbc6e32012fe29f1a6c67ddc90facb43ebeee.tar.bz2 edk2-832fbc6e32012fe29f1a6c67ddc90facb43ebeee.zip |
SecurityPkg: add TIS sanity check (tpm2)
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 Tpm2PtpInterfaceTis in case it matches, Tpm2PtpInterfaceMax
otherwise.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'SecurityPkg')
-rw-r--r-- | SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c b/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c index 1f9ac5ab5a..eac9f0e299 100644 --- a/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c +++ b/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c @@ -464,7 +464,11 @@ Tpm2GetPtpInterface ( return Tpm2PtpInterfaceFifo;
}
- return Tpm2PtpInterfaceTis;
+ if (InterfaceId.Bits.InterfaceType == PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_TIS) {
+ return Tpm2PtpInterfaceTis;
+ }
+
+ return Tpm2PtpInterfaceMax;
}
/**
|