All of
 help / color / mirror / Atom feed
From: Tianjia Zhang <>
Subject: [PATCH] tpm: Remove redundant function grub_tpm_measure
Date: Wed, 13 May 2020 16:53:53 +0800	[thread overview]
Message-ID: <> (raw)

The grub_tpm_measure() is only used by tpm.c, and this function
is the simple wrapper of grub_tpm_event_log(). So remove it and
keep the code cleaner.

Signed-off-by: Tianjia Zhang <>
 grub-core/commands/tpm.c | 12 ++----------
 include/grub/tpm.h       |  2 --
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/grub-core/commands/tpm.c b/grub-core/commands/tpm.c
index 1441c494d..cbe4116ec 100644
--- a/grub-core/commands/tpm.c
+++ b/grub-core/commands/tpm.c
@@ -29,13 +29,6 @@
-grub_tpm_measure (unsigned char *buf, grub_size_t size, grub_uint8_t pcr,
-		  const char *description)
-  return grub_tpm_log_event (buf, size, pcr, description);
 static grub_err_t
 grub_tpm_verify_init (grub_file_t io,
 		      enum grub_file_type type __attribute__ ((unused)),
@@ -49,7 +42,7 @@ grub_tpm_verify_init (grub_file_t io,
 static grub_err_t
 grub_tpm_verify_write (void *context, void *buf, grub_size_t size)
-  return grub_tpm_measure (buf, size, GRUB_BINARY_PCR, context);
+  return grub_tpm_log_event (buf, size, GRUB_BINARY_PCR, context);
 static grub_err_t
@@ -77,8 +70,7 @@ grub_tpm_verify_string (char *str, enum grub_verify_string_type type)
   grub_memcpy (description, prefix, grub_strlen (prefix));
   grub_memcpy (description + grub_strlen (prefix), str,
 	       grub_strlen (str) + 1);
-  status =
-    grub_tpm_measure ((unsigned char *) str, grub_strlen (str),
+  status = grub_tpm_log_event ((unsigned char *) str, grub_strlen (str),
 		      GRUB_STRING_PCR, description);
   grub_free (description);
   return status;
diff --git a/include/grub/tpm.h b/include/grub/tpm.h
index dfcbe8372..8a686214a 100644
--- a/include/grub/tpm.h
+++ b/include/grub/tpm.h
@@ -72,8 +72,6 @@ typedef struct
   grub_uint8_t  outDigest[SHA1_DIGEST_SIZE];
 } GRUB_PACKED ExtendOutgoing;
-grub_err_t grub_tpm_measure (unsigned char *buf, grub_size_t size,
-			     grub_uint8_t pcr, const char *description);
 grub_err_t grub_tpm_init (void);
 grub_err_t grub_tpm_execute (PassThroughToTPM_InputParamBlock *inbuf,
 			     PassThroughToTPM_OutputParamBlock *outbuf);

             reply	other threads:[~2020-05-13  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13  8:53 Tianjia Zhang [this message]
2020-05-13 12:45 ` [PATCH] tpm: Remove redundant function grub_tpm_measure Daniel Kiper
2020-05-13 13:08   ` Tianjia Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.