diff mbox series

[ima-evm-utils,4/4] Fix tpm2_pcr_supported() output messages

Message ID 20220914142225.1381077-5-zohar@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series misc bug and other fixes | expand

Commit Message

Mimi Zohar Sept. 14, 2022, 2:22 p.m. UTC
Remove unnecessary path check in pcr_ibmtss.c and update the syntax
in the other.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
---
 src/pcr_ibmtss.c     | 12 +-----------
 src/pcr_tsspcrread.c |  4 ++--
 2 files changed, 3 insertions(+), 13 deletions(-)

Comments

Stefan Berger Sept. 14, 2022, 9:21 p.m. UTC | #1
On 9/14/22 10:22, Mimi Zohar wrote:
> Remove unnecessary path check in pcr_ibmtss.c and update the syntax
> in the other.
> 
> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
> ---
>   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 b8700ddd5da8..6b38d280e80c 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 <ibmtss/tss.h>
>   
> -#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);
> -
> -	if (get_cmd_path(CMD, path, sizeof(path))) {
> -		log_debug("Couldn't find '%s' in $PATH\n", CMD);
> -		return 0;
> -	}
> +		log_info("Using ibmtss to read PCRs.\n");
>   
> -	log_debug("Found '%s' in $PATH\n", CMD);
>   	return 1;
>   }
>   
> diff --git a/src/pcr_tsspcrread.c b/src/pcr_tsspcrread.c
> index 95048f8a5469..39ff8f7fc14d 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;
>   }
>   

Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
diff mbox series

Patch

diff --git a/src/pcr_ibmtss.c b/src/pcr_ibmtss.c
index b8700ddd5da8..6b38d280e80c 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 <ibmtss/tss.h>
 
-#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);
-
-	if (get_cmd_path(CMD, path, sizeof(path))) {
-		log_debug("Couldn't find '%s' in $PATH\n", CMD);
-		return 0;
-	}
+		log_info("Using ibmtss to read PCRs.\n");
 
-	log_debug("Found '%s' in $PATH\n", CMD);
 	return 1;
 }
 
diff --git a/src/pcr_tsspcrread.c b/src/pcr_tsspcrread.c
index 95048f8a5469..39ff8f7fc14d 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;
 }