]> git.ipfire.org Git - thirdparty/systemd.git/commit
tpm2: add tpm2_get_capability_handle(), tpm2_esys_handle_from_tpm_handle()
authorDan Streetman <ddstreet@ieee.org>
Fri, 17 Feb 2023 17:50:31 +0000 (12:50 -0500)
committerDan Streetman <ddstreet@ieee.org>
Thu, 8 Jun 2023 10:08:03 +0000 (06:08 -0400)
commitc8a85240316898a6de95c9b2565edd08f8450182
tree6ae54be7798c51c322ebf783711608781f45ff77
parent438874cb105736e1fb59d67127c42a68f30bdf20
tpm2: add tpm2_get_capability_handle(), tpm2_esys_handle_from_tpm_handle()

Add tpm2_get_capability_handle() to query if a "TPM handle" (meaning, a
location/address in TPM storage) is populated in the TPM, and
tpm2_get_capability_handles() to query for a specific number of handles.

Add tpm2_esys_handle_from_tpm_handle() to create an "esys handle" (an opaque
reference for use with the TPM EAPI that represents a TPM handle address) for an
existing TPM handle.

Since the TPM handle already exists in the TPM, this also also requires
updating the cleanup code for Tpm2Handle objects to close the object (free its
resources only from the EAPI code, but leave the handle in the TPM) instead of
flush the object (which frees its EAPI resources and removes it from the TPM).
src/shared/tpm2-util.c
src/shared/tpm2-util.h