1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef COMMONLIB_TPM_LOG_SERIALIZED_H 4 #define COMMONLIB_TPM_LOG_SERIALIZED_H 5 6 #include <commonlib/bsd/helpers.h> 7 #include <stdint.h> 8 9 #define TPM_CB_LOG_DIGEST_MAX_LENGTH 64 10 #define TPM_CB_LOG_PCR_HASH_NAME 50 11 #define TPM_CB_LOG_PCR_HASH_LEN 10 12 13 struct tpm_cb_log_entry { 14 uint32_t pcr; 15 char digest_type[TPM_CB_LOG_PCR_HASH_LEN]; 16 uint8_t digest[TPM_CB_LOG_DIGEST_MAX_LENGTH]; 17 uint32_t digest_length; 18 char name[TPM_CB_LOG_PCR_HASH_NAME]; 19 } __packed; 20 21 struct tpm_cb_log_table { 22 uint16_t max_entries; 23 uint16_t num_entries; 24 struct tpm_cb_log_entry entries[]; /* Variable number of entries */ 25 } __packed; 26 27 #endif 28