From c1a7eb2c75c4007bddb0afc73189d9d15fb552c0 Mon Sep 17 00:00:00 2001 From: Andrey Pronin Date: Fri, 6 Oct 2017 20:01:53 -0700 Subject: tlcl, tpmc: extend GetVersion to report vendor specific data 1) Extend TlclGetVersion to return vendor specific data, if requested. 2) Extend 'tpmc getver' to include vendor specific data. BRANCH=none BUG=chromium:771561 TEST=unit tests, running 'tpmc getver' Change-Id: Ic04c242d4e6f33b45a80479be9ab9777b317ebe2 Reviewed-on: https://chromium-review.googlesource.com/706240 Commit-Ready: Andrey Pronin Tested-by: Andrey Pronin Reviewed-by: Andrey Pronin (cherry picked from commit 3b805725c15022783f0737a72b4f27962abf48cd) Reviewed-on: https://chromium-review.googlesource.com/733664 Commit-Queue: Andrey Pronin --- firmware/include/tlcl.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'firmware/include/tlcl.h') diff --git a/firmware/include/tlcl.h b/firmware/include/tlcl.h index fba764c9..f8d94721 100644 --- a/firmware/include/tlcl.h +++ b/firmware/include/tlcl.h @@ -208,8 +208,17 @@ uint32_t TlclGetRandom(uint8_t *data, uint32_t length, uint32_t *size); /** * Requests version information from the TPM. - */ -uint32_t TlclGetVersion(uint32_t *vendor, uint64_t *firmware_version); + * If vendor_specific_buf_size != NULL, requests also the vendor-specific + * variable-length part of the version: + * if vendor_specific_buf == NULL, determines its size and returns in + * *vendor_specific_buf_size; + * if vendor_specific_buf != NULL, fills the buffer until either the + * end of the vendor specific data or the end of the buffer, sets + * *vendor_specific_buf_size to the length of the filled data. + */ +uint32_t TlclGetVersion(uint32_t* vendor, uint64_t* firmware_version, + uint8_t* vendor_specific_buf, + size_t* vendor_specific_buf_size); /** * Issues the IFX specific FieldUpgradeInfoRequest2 TPM_FieldUpgrade subcommand -- cgit v1.2.1