From 76e3303290f7f17d5318e87321567188f165cc2a Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Fri, 30 Jan 2015 18:45:27 -0800 Subject: chromeos: vboot2: Add TPM PCR extension support ChromeOS/vboot devices expect the TPM PCRs 0 and 1 to be extended with digests that attest the chosen boot mode (developer/recovery) and the HWID in a secure way. This patch uses the newly added vboot2 support functions to fetch these digests and store them in the TPM. CQ-DEPEND=CL:244542 BRANCH=veyron BUG=chromium:451609 TEST=Booted Jerry. Confirmed that PCR0 contains the same value as on my vboot1 Blaze and Falco (and PCR1 contains some non-zero hash). Original-Change-Id: I7037b8198c09fccee5440c4c85f0821166784cec Original-Signed-off-by: Julius Werner Original-Reviewed-on: https://chromium-review.googlesource.com/245119 Original-Reviewed-by: Aaron Durbin Original-Reviewed-by: Daisuke Nojiri (cherry picked from commit 8b44e13098cb7493091f2ce6c4ab423f2cbf0177) Signed-off-by: Aaron Durbin Change-Id: I549de8c07353683633fbf73e4ee62ba0ed72ff89 Reviewed-on: http://review.coreboot.org/9706 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer Reviewed-by: Paul Menzel --- src/lib/tlcl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/tlcl.c') diff --git a/src/lib/tlcl.c b/src/lib/tlcl.c index c37b51a532..ccf4e8004b 100644 --- a/src/lib/tlcl.c +++ b/src/lib/tlcl.c @@ -320,7 +320,8 @@ uint32_t tlcl_extend(int pcr_num, const uint8_t* in_digest, if (result != TPM_SUCCESS) return result; - memcpy(out_digest, response + kTpmResponseHeaderLength, - kPcrDigestLength); + if (out_digest) + memcpy(out_digest, response + kTpmResponseHeaderLength, + kPcrDigestLength); return result; } -- cgit v1.2.3