From 7aaf923d0bf5ed9c85ee1915e2b610b494f6e4f5 Mon Sep 17 00:00:00 2001 From: Mimi Zohar Date: Wed, 14 Sep 2022 08:26:39 -0400 Subject: [PATCH] Fix tpm2_pcr_supported() output messages Remove unnecessary path check in pcr_ibmtss.c and update the syntax in the other. Reviewed-by: Stefan Berger Signed-off-by: Mimi Zohar --- src/pcr_ibmtss.c | 12 +----------- src/pcr_tsspcrread.c | 4 ++-- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/pcr_ibmtss.c b/src/pcr_ibmtss.c index b8700dd..3275b20 100644 --- a/src/pcr_ibmtss.c +++ b/src/pcr_ibmtss.c @@ -20,21 +20,11 @@ #undef MAX_DIGEST_SIZE /* imaevm uses a different value than the TSS */ #include -#define CMD "tsspcrread" - -static char path[PATH_MAX]; - int tpm2_pcr_supported(void) { if (imaevm_params.verbose > LOG_INFO) - log_info("Using %s to read PCRs.\n", CMD); + log_info("Using ibmtss to read PCRs\n"); - if (get_cmd_path(CMD, path, sizeof(path))) { - log_debug("Couldn't find '%s' in $PATH\n", CMD); - return 0; - } - - log_debug("Found '%s' in $PATH\n", CMD); return 1; } diff --git a/src/pcr_tsspcrread.c b/src/pcr_tsspcrread.c index 95048f8..39ff8f7 100644 --- a/src/pcr_tsspcrread.c +++ b/src/pcr_tsspcrread.c @@ -60,11 +60,11 @@ int tpm2_pcr_supported(void) log_info("Using %s to read PCRs.\n", CMD); if (get_cmd_path(CMD, path, sizeof(path))) { - log_debug("Couldn't find '%s' in $PATH\n", CMD); + log_info("Couldn't find '%s' in %s\n", CMD, path); return 0; } - log_debug("Found '%s' in $PATH\n", CMD); + log_debug("Found '%s' in %s\n", CMD, path); return 1; }