summaryrefslogtreecommitdiff
path: root/src/security
diff options
context:
space:
mode:
authorRichard Spiegel <richard.spiegel@amd.corp-partner.google.com>2018-08-07 09:24:14 -0700
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2018-08-08 23:53:15 +0000
commit248c60a672faacd5e3adb4df5204ff9d97e55b3d (patch)
treecf8b9a6899c4fa580033720a1a74b89d4d692e02 /src/security
parent486df4612d18cf74e7bbcaa009d37e33199cd8fc (diff)
security/tpm: Report tpm_unmarshal_response warning
In procedure tpm_unmarshal_response(), variable "rc" is used early to decide if it should return NULL. Later however, the code proceeds to its end even if one subroutine reports error. If "rc" is not 0, report that there was a partial error in the procedure. BUG=b:112253891 TEST=Build and boot grunt. Change-Id: I7575bc75104fd97f138224aa57561e68f6548e58 Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com> Reviewed-on: https://review.coreboot.org/27931 Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/security')
-rw-r--r--src/security/tpm/tss/tcg-2.0/tss_marshaling.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/security/tpm/tss/tcg-2.0/tss_marshaling.c b/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
index 86f2231c3f..94bfbcfb10 100644
--- a/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
+++ b/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
@@ -554,6 +554,9 @@ struct tpm2_response *tpm_unmarshal_response(TPM_CC command, struct ibuf *ib)
command, ibuf_remaining(ib));
return NULL;
}
+ if (rc)
+ printk(BIOS_WARNING, "Warning: %s had one or more failures.\n",
+ __func__);
/* The entire message have been parsed. */
return tpm2_resp;