All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Lin via Grub-devel <grub-devel@gnu.org>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: Gary Lin <glin@suse.com>, Daniel Kiper <daniel.kiper@oracle.com>,
	mchang@suse.com, patrick.colp@oracle.com,
	Stefan Berger <stefanb@linux.ibm.com>,
	Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Subject: [PATCH v2 2/7] tss2: Introduce grub_tcg2_cap_pcr()
Date: Tue, 15 Jul 2025 13:36:29 +0800	[thread overview]
Message-ID: <20250715053634.20799-3-glin@suse.com> (raw)
In-Reply-To: <20250715053634.20799-1-glin@suse.com>

This commit introduces the definition of grub_tcg2_cap_pcr(), a new
function designed to enhance the security of sealed keys. Its primary
purpose is to "cap" a specific PCR by extending it with an EV_SEPARATOR
event. This action cryptographically alters the PCR value, making it
impossible to unseal any key that was previously sealed to the original
PCR state. Consequently, the sealed key remains protected against
unauthorized unsealing attempts until the associated PCRs are reset to
their initial configuration, typically occurring during a subsequent
system boot.

Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
---
 grub-core/lib/tss2/tcg2.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/grub-core/lib/tss2/tcg2.h b/grub-core/lib/tss2/tcg2.h
index 3d26373dd..c7e80d355 100644
--- a/grub-core/lib/tss2/tcg2.h
+++ b/grub-core/lib/tss2/tcg2.h
@@ -23,6 +23,8 @@
 #include <grub/err.h>
 #include <grub/types.h>
 
+#define EV_SEPARATOR 0x04
+
 extern grub_err_t
 grub_tcg2_get_max_output_size (grub_size_t *size);
 
@@ -32,4 +34,7 @@ grub_tcg2_submit_command (grub_size_t input_size,
 			  grub_size_t output_size,
 			  grub_uint8_t *output);
 
+extern grub_err_t
+grub_tcg2_cap_pcr (grub_uint8_t pcr);
+
 #endif /* ! GRUB_TPM2_TCG2_HEADER */
-- 
2.43.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

  parent reply	other threads:[~2025-07-15  5:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15  5:36 [PATCH v2 0/7] TPM2 PCR Capping Gary Lin via Grub-devel
2025-07-15  5:36 ` [PATCH v2 1/7] tss2: Add TPM2_PCR_Event command Gary Lin via Grub-devel
2025-07-17  6:54   ` Sudhakar Kuppusamy
2025-07-15  5:36 ` Gary Lin via Grub-devel [this message]
2025-07-17  6:55   ` [PATCH v2 2/7] tss2: Introduce grub_tcg2_cap_pcr() Sudhakar Kuppusamy
2025-07-15  5:36 ` [PATCH v2 3/7] tss2: Implement grub_tcg2_cap_pcr() for EFI Gary Lin via Grub-devel
2025-07-17  7:14   ` Sudhakar Kuppusamy
2025-07-15  5:36 ` [PATCH v2 4/7] tss2: Implement grub_tcg2_cap_pcr() for ieee1275 Gary Lin via Grub-devel
2025-07-15  5:36 ` [PATCH v2 5/7] tss2: Implement grub_tcg2_cap_pcr() for EMU Gary Lin via Grub-devel
2025-07-17  7:30   ` Sudhakar Kuppusamy
2025-07-15  5:36 ` [PATCH v2 6/7] tpm2_key_protector: Support PCR capping Gary Lin via Grub-devel
2025-07-15  5:36 ` [PATCH v2 7/7] tests/tpm2_key_protector_test: Add a test for PCR Capping Gary Lin via Grub-devel

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20250715053634.20799-3-glin@suse.com \
    --to=grub-devel@gnu.org \
    --cc=daniel.kiper@oracle.com \
    --cc=glin@suse.com \
    --cc=mchang@suse.com \
    --cc=patrick.colp@oracle.com \
    --cc=stefanb@linux.ibm.com \
    --cc=sudhakar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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.