From 1a88cbad565ede91f02aa4cae9a7ded35229f61b Mon Sep 17 00:00:00 2001 From: Dimitar Tomov Date: Sat, 11 Jul 2020 00:51:08 +0300 Subject: [PATCH] Add print for TPM uptime since last power-up and modify message for TPM clock Signed-off-by: Dimitar Tomov --- examples/timestamp/signed_timestamp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/timestamp/signed_timestamp.c b/examples/timestamp/signed_timestamp.c index 97b7f32..a18e85c 100644 --- a/examples/timestamp/signed_timestamp.c +++ b/examples/timestamp/signed_timestamp.c @@ -221,7 +221,10 @@ int TPM2_Timestamp_Test(void* userCtx) printf("TPM with signature attests (type 0x%x):\n", attestedData.type); /* time value in milliseconds that advances while the TPM is powered */ - printf("\tUptime (in ms) since power-up: %lu\n", + printf("\tTPM uptime since last power-up(in ms): %lu\n", + (unsigned long)attestedData.attested.time.time.time); + /* time value in milliseconds that advances while the TPM is powered */ + printf("\tTPM clock, total time the TPM has been on(in ms): %lu\n", (unsigned long)attestedData.attested.time.time.clockInfo.clock); /* number of occurrences of TPM Reset since the last TPM2_Clear() */ printf("\tReset Count: %u\n", @@ -233,7 +236,7 @@ int TPM2_Timestamp_Test(void* userCtx) printf("\tClock Safe: %u\n", attestedData.attested.time.time.clockInfo.safe); /* a TPM vendor-specific value indicating the version number of the firmware */ - printf("\tFirmware Version: %lu\n", + printf("\tFirmware Version(vendor specific): 0x%lX\n", (unsigned long)attestedData.attested.time.firmwareVersion); exit: