diff options
Diffstat (limited to 'libstb/tpm_chip.h')
-rw-r--r-- | libstb/tpm_chip.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libstb/tpm_chip.h b/libstb/tpm_chip.h index b8f536c..d7363e7 100644 --- a/libstb/tpm_chip.h +++ b/libstb/tpm_chip.h @@ -20,6 +20,7 @@ #include <device.h> #include "tss/tpmLogMgr.H" +#include "tss/trustedTypes.H" struct tpm_dev { @@ -73,6 +74,31 @@ typedef struct tpm_chip TpmTarget; extern int tpm_register_chip(struct dt_node *node, struct tpm_dev *dev, struct tpm_driver *driver); +/* + * tpm_extendl - For each TPM device, this extends the sha1 and sha 256 digests + * to the indicated PCR and also records an event for the same PCR + * in the event log + * This calls a TSS extend function that supports multibank. Both sha1 and + * sha256 digests are extended in a single operation sent to the TPM device. + * + * @pcr: PCR number to be extended and recorded in the event log. The same PCR + * number is extende for both sha1 and sha256 banks. + * @alg1: SHA algorithm of digest1. Either TPM_ALG_SHA1 or TPM_ALG_SHA256 + * @digest1: digest1 buffer + * @size1: size of digest1. Either TPM_ALG_SHA1_SIZE or TPM_ALG_SHA256_SIZE + * @alg2: SHA algorithm of digest2. Either TPM_ALG_SHA1 or TPM_ALG_SHA256 + * @digest2: digest2 buffer + * @size2: size of digest2. Either TPM_ALG_SHA1_SIZE or TPM_ALG_SHA256_SIZE + * @event_type: event type log. In skiboot, either EV_ACTION or EV_SEPARATOR. + * @event_msg: event log message that describes the event + * + * Returns O for success or a negative number if it fails. + */ +extern int tpm_extendl(TPM_Pcr pcr, + TPM_Alg_Id alg1, uint8_t* digest1, size_t size1, + TPM_Alg_Id alg2, uint8_t* digest2, size_t size2, + uint32_t event_type, const char* event_msg); + /* Add status property to the TPM devices */ extern void tpm_add_status_property(void); |