QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix SubmitCommand() out size
authorMichael Kinney <michael.d.kinney@intel.com>
Tue, 10 Jan 2017 17:08:52 +0000 (09:08 -0800)
committerMichael Kinney <michael.d.kinney@intel.com>
Wed, 11 Jan 2017 19:11:22 +0000 (11:11 -0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=336

When the Tpm12SubmitCommand() detects a response packet that
is the same size as a TPM_RSP_COMMAND_HDR, it returns
EFI_SUCCESS without reading any additional response packet
information from the TPM.  In that case, the return parameter
OutputParameterBlockSize is not be updated, so the size of
that OutputParameterBlock returned is the value passed in which
could be larger than what is actually returned from the TPM.

Set the OutputParameterBlockSize to the size of the
TPM_RSP_COMMAND_HDR when this specific condition is detected.

Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Lee Leahy <leroy.p.leahy@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Lee Leahy <leroy.p.leahy@intel.com>
QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c

index 08a005f..3aab530 100644 (file)
@@ -355,6 +355,7 @@ Tpm12SubmitCommand (
 \r
   TpmOutSize = SwapBytes32 (ReadUnaligned32 (&ResponseHeader->paramSize));\r
   if (TpmOutSize == sizeof (TPM_RSP_COMMAND_HDR)) {\r
+    *OutputParameterBlockSize = TpmOutSize;\r
     Status = EFI_SUCCESS;\r
     goto Done;\r
   }\r