]> git.ipfire.org Git - thirdparty/grub.git/commit
tpm2_key_protector: Unseal key from a buffer
authorGary Lin <glin@suse.com>
Mon, 7 Apr 2025 08:29:19 +0000 (16:29 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 10 Apr 2025 16:05:58 +0000 (18:05 +0200)
commitfa69deac565e5d5015ca396b017239cd96900673
tree7155d1229ac23c7e3b64bb775b593f616320c904
parent75c480885ab00fb9bc046fe214df60007116aef2
tpm2_key_protector: Unseal key from a buffer

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.

Besides this, to avoid introducing more options for the NV index mode,
the file format is detected automatically before unmarshaling the data,
so there is no need to use the command option to specify the file format
anymore. In other words, "-T" and "-k" are the same now.

Also update grub.text to address the change.

Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
docs/grub.texi
grub-core/commands/tpm2_key_protector/module.c