[PATCH v4 09/12] tests/tpm2_key_protector_test: Reset 'ret' on fail

2025-03-21 Thread Gary Lin via Grub-devel
Reset 'ret' to 0 when a test case fails so that the other test cases could continue. Signed-off-by: Gary Lin --- tests/tpm2_key_protector_test.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/tpm2_key_protector_test.in b/tests/tpm2_key_protector_test.in index 07477ba2a..0d1115e02 1

[PATCH v4 05/12] tpm2_key_protector: Unseal key from a buffer

2025-03-21 Thread Gary Lin via Grub-devel
Extract the logic to handle the file buffer from the SRK recover function to prepare to load the sealed key from the NV index handle, so the NV index mode can share the same code path in the later patch. The SRK recover function now only reads the file and sends the file buffer to the new function.

[PATCH v4 06/12] tpm2_key_protector: Support NV index handles

2025-03-21 Thread Gary Lin via Grub-devel
Previously, NV index mode only supported persistent handles which are only for TPM objects. On the other hand, the "NV index" handle allows the user-defined data, so it can be an alternative to the key file and support TPM 2.0 Key File format immediately. The following tpm2-tools commands store t

[PATCH v4 00/12] TPM2 key protector follow-up patches

2025-03-21 Thread Gary Lin via Grub-devel
git: https://github.com/lcp/grub2/tree/tpm2-follow-up-v4 This patchset is the collection of several enhancements for TPM2 key protector. * Patch 1 introduces the PCR dump to help debugging policy fail. * Patch 2 adds the new command to dump PCRs in GRUB shell and the * documentation of the comman

[PATCH v4 03/12] tss2: Fix the missing authCommand

2025-03-21 Thread Gary Lin via Grub-devel
grub_tpm2_readpublic() and grub_tpm2_testparms() didn't check 'authCommand' when marshaling the input data buffer. Currently, there is no caller using non-NULL 'authCommand'. However, to avoid the potential issue, the conditional check is added to insert 'authCommand' into the input buffer if neces

[PATCH v4 02/12] tpm2_key_protector: Add 'tpm2_dump_pcr' command

2025-03-21 Thread Gary Lin via Grub-devel
The user may need to inspect the TPM 2.0 PCR values with the GRUB shell, so the new 'tpm2_dump_pcr' command is added to print all PCRs of the specified bank. Also update the document for the new command. Signed-off-by: Gary Lin Tested-by: Stefan Berger Reviewed-by: Daniel Kiper --- docs/grub.

[PATCH v4 04/12] tss2: Add TPM 2.0 NV index commands

2025-03-21 Thread Gary Lin via Grub-devel
The following TPM 2.0 commands are introduced to tss2 to access the TPM non-volatile memory associated with the NV index handles. - TPM2_NV_DefineSpace - TPM2_NV_UndefineSpace - TPM2_NV_ReadPublic - TPM2_NV_Read - TPM2_NV_Write The related marshal/unmarshal functions are also introduced. Signed-

Re: [PATCH v2 1/7] luks2: Add token parsing support

2025-03-21 Thread Gary Lin via Grub-devel
On Fri, Mar 14, 2025 at 02:58:48PM +0100, Yann Diorcet wrote: > For the moment only the system-tpm2 token type is supported. > Hi Yann, Could you consider creating a cover letter for this patch set? A cover letter is useful for the reviewer to have the overview of the patches before diving into th

[RFC] Rust in GRUB

2025-03-21 Thread Vladimir 'phcoder' Serbinenko
Hello, I was playing with adding Rust embedded in GRUB. I’ve pushed results to 2 repos: Module goes to https://github.com/phcoder/grub-rust-hello/tree/master Changes in GRUB are found at https://github.com/phcoder/GRUB/tree/rust Notes on implementation: Only i386-pc is implemented right now but it’

Re: [PATCH v6 2/2] efi: new 'connectefi' command

2025-03-21 Thread Daniel Kiper
On Wed, Mar 19, 2025 at 01:47:57PM +0100, Renaud Métrich via Grub-devel wrote: > When network booting is used, trying to chainload to the local disk > (which is used in deployment tools such as Red Hat Satellite) may fail > when searching for the boot loader, e.g. /EFI/redhat/shimx64.efi: > the boo

Re: [RFC] Rust in GRUB

2025-03-21 Thread Ross Philipson via Grub-devel
On 3/21/25 5:19 PM, Andrew Hamilton wrote: Hello, Personally, I really like this idea. I second that. One of the areas I think (I am not a Rust programmer) Rust could really help GRUB is in the many large and imposing parsing routines in modules. From what I have read and heard, Rust could i

Re: [RFC] Rust in GRUB

2025-03-21 Thread Andrew Hamilton
Hello, Personally, I really like this idea. I'm not yet a Rust programmer but I am happy to learn... and perhaps there are others like me that would take this as an opportunity to learn while doing something like porting a Grub module from C to Rust if we had that framework in place. It seems li