Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v4.12-rc2 137 lines 2.5 kB view raw
1 2#ifndef __TPM_EVENTLOG_H__ 3#define __TPM_EVENTLOG_H__ 4 5#include <crypto/hash_info.h> 6 7#define TCG_EVENT_NAME_LEN_MAX 255 8#define MAX_TEXT_EVENT 1000 /* Max event string length */ 9#define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */ 10#define TPM2_ACTIVE_PCR_BANKS 3 11 12#ifdef CONFIG_PPC64 13#define do_endian_conversion(x) be32_to_cpu(x) 14#else 15#define do_endian_conversion(x) x 16#endif 17 18enum bios_platform_class { 19 BIOS_CLIENT = 0x00, 20 BIOS_SERVER = 0x01, 21}; 22 23struct tcpa_event { 24 u32 pcr_index; 25 u32 event_type; 26 u8 pcr_value[20]; /* SHA1 */ 27 u32 event_size; 28 u8 event_data[0]; 29}; 30 31enum tcpa_event_types { 32 PREBOOT = 0, 33 POST_CODE, 34 UNUSED, 35 NO_ACTION, 36 SEPARATOR, 37 ACTION, 38 EVENT_TAG, 39 SCRTM_CONTENTS, 40 SCRTM_VERSION, 41 CPU_MICROCODE, 42 PLATFORM_CONFIG_FLAGS, 43 TABLE_OF_DEVICES, 44 COMPACT_HASH, 45 IPL, 46 IPL_PARTITION_DATA, 47 NONHOST_CODE, 48 NONHOST_CONFIG, 49 NONHOST_INFO, 50}; 51 52struct tcpa_pc_event { 53 u32 event_id; 54 u32 event_size; 55 u8 event_data[0]; 56}; 57 58enum tcpa_pc_event_ids { 59 SMBIOS = 1, 60 BIS_CERT, 61 POST_BIOS_ROM, 62 ESCD, 63 CMOS, 64 NVRAM, 65 OPTION_ROM_EXEC, 66 OPTION_ROM_CONFIG, 67 OPTION_ROM_MICROCODE = 10, 68 S_CRTM_VERSION, 69 S_CRTM_CONTENTS, 70 POST_CONTENTS, 71 HOST_TABLE_OF_DEVICES, 72}; 73 74/* http://www.trustedcomputinggroup.org/tcg-efi-protocol-specification/ */ 75 76struct tcg_efi_specid_event_algs { 77 u16 alg_id; 78 u16 digest_size; 79} __packed; 80 81struct tcg_efi_specid_event { 82 u8 signature[16]; 83 u32 platform_class; 84 u8 spec_version_minor; 85 u8 spec_version_major; 86 u8 spec_errata; 87 u8 uintnsize; 88 u32 num_algs; 89 struct tcg_efi_specid_event_algs digest_sizes[TPM2_ACTIVE_PCR_BANKS]; 90 u8 vendor_info_size; 91 u8 vendor_info[0]; 92} __packed; 93 94struct tcg_pcr_event { 95 u32 pcr_idx; 96 u32 event_type; 97 u8 digest[20]; 98 u32 event_size; 99 u8 event[0]; 100} __packed; 101 102struct tcg_event_field { 103 u32 event_size; 104 u8 event[0]; 105} __packed; 106 107struct tcg_pcr_event2 { 108 u32 pcr_idx; 109 u32 event_type; 110 u32 count; 111 struct tpm2_digest digests[TPM2_ACTIVE_PCR_BANKS]; 112 struct tcg_event_field event; 113} __packed; 114 115extern const struct seq_operations tpm2_binary_b_measurements_seqops; 116 117#if defined(CONFIG_ACPI) 118int tpm_read_log_acpi(struct tpm_chip *chip); 119#else 120static inline int tpm_read_log_acpi(struct tpm_chip *chip) 121{ 122 return -ENODEV; 123} 124#endif 125#if defined(CONFIG_OF) 126int tpm_read_log_of(struct tpm_chip *chip); 127#else 128static inline int tpm_read_log_of(struct tpm_chip *chip) 129{ 130 return -ENODEV; 131} 132#endif 133 134int tpm_bios_log_setup(struct tpm_chip *chip); 135void tpm_bios_log_teardown(struct tpm_chip *chip); 136 137#endif