util/docker/doc.coreboot.org: Allow git to work in envs owned by root
[coreboot2.git] / src / security / tpm / tpm1_log_serialized.h
blob7c7d51a45a9790521e30cf9e9a0fef7e096ad2e8
1 /* SPDX-License-Identifier: BSD-3-Clause */
3 #ifndef __TPM1_LOG_SERIALIZED_H__
4 #define __TPM1_LOG_SERIALIZED_H__
6 #include <commonlib/bsd/helpers.h>
7 #include <commonlib/bsd/tpm_log_defs.h>
8 #include <stdint.h>
10 #define TPM_1_LOG_DIGEST_MAX_LENGTH 20
11 #define TPM_1_LOG_DATA_MAX_LENGTH 50
13 #define TPM_1_LOG_VI_MAGIC 0x31544243 /* "CBT1" in LE */
14 #define TPM_1_LOG_VI_MAJOR 1
15 #define TPM_1_LOG_VI_MINOR 0
17 struct tpm_1_log_entry {
18 uint32_t pcr;
19 uint32_t event_type;
20 uint8_t digest[TPM_1_LOG_DIGEST_MAX_LENGTH];
21 uint32_t data_length;
22 uint8_t data[TPM_1_LOG_DATA_MAX_LENGTH];
23 } __packed;
25 struct tpm_1_vendor {
26 uint8_t reserved;
27 uint8_t version_major;
28 uint8_t version_minor;
29 uint32_t magic;
30 uint16_t max_entries;
31 uint16_t num_entries;
32 uint32_t entry_size;
33 } __packed;
35 struct tpm_1_log_table {
36 /* The first entry of the log is inlined and describes the log itself */
37 uint32_t pcr;
38 uint32_t event_type;
39 uint8_t digest[TPM_1_LOG_DIGEST_MAX_LENGTH];
40 uint32_t spec_id_size;
41 struct spec_id_event_data spec_id;
42 struct tpm_1_vendor vendor;
44 struct tpm_1_log_entry entries[]; /* Variable number of entries */
45 } __packed;
47 #endif