diff options
author | Du Lin <du.lin@intel.com> | 2024-03-12 10:30:06 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-03-15 09:05:25 +0000 |
commit | ccbbc2a5c84a0330b28b726ef0936fc16937005a (patch) | |
tree | 9d4fdc99c24068422a4590a501f77bb008e85000 | |
parent | e7486b50646d6a645706b61d2f8d74b3dca23ce0 (diff) | |
download | edk2-ccbbc2a5c84a0330b28b726ef0936fc16937005a.zip edk2-ccbbc2a5c84a0330b28b726ef0936fc16937005a.tar.gz edk2-ccbbc2a5c84a0330b28b726ef0936fc16937005a.tar.bz2 |
IntelFsp2WrapperPkg: Error handling of TpmMeasureAndLogDataWithFlags()
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4700
TpmMeasureAndLogDataWithFlags() computes the measure the code and
log it into PCR 0. TpmMeasureAndLogData() computes the hash for the
configuration. The same "Status" variable is used to store the return
values for both of the functions. There is no error handling if
TpmMeasureAndLogDataWithFlags() returns an error Status.
Fix the issue by adding error handling for TpmMeasureAndLogDataWithFlags().
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Chen Gang C <gang.c.chen@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Susovan Mohapatra <susovan.mohapatra@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Signed-off-by: Du Lin <du.lin@intel.com>
Reviewed-by: Ashraf Ali S <ashraf.ali.s@intel.com>
Reviewed-by: Chen Gang C <gang.c.chen@intel.com>
-rw-r--r-- | IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c index 2c017a4..2282776 100644 --- a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c +++ b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c @@ -197,6 +197,10 @@ MeasureFspFirmwareBlobWithCfg ( (UINTN)sizeof (DigestList),
EDKII_TCG_PRE_HASH_LOG_ONLY
);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "TpmMeasureAndLogDataWithFlags failed - %r\n", Status));
+ return Status;
+ }
Status = TpmMeasureAndLogData (
1,
|