![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <security/tpm/tss.h>
#include <commonlib/tcpa_log_serialized.h>
#include <commonlib/region.h>
#include <vb2_api.h>
Go to the source code of this file.
Macros | |
#define | TPM_PCR_MAX_LEN 64 |
#define | HASH_DATA_CHUNK_SIZE 1024 |
Functions | |
struct tcpa_table * | tcpa_log_init (void) |
Get the pointer to the single instance of global tcpa log data, and initialize it when necessary. More... | |
void | tcpa_preram_log_clear (void) |
Clears the pre-RAM tcpa log data and initializes any content with default values. More... | |
void | tcpa_log_add_table_entry (const char *name, const uint32_t pcr, enum vb2_hash_algorithm digest_algo, const uint8_t *digest, const size_t digest_len) |
Add table entry for cbmem TCPA log. More... | |
void | tcpa_log_dump (void *unused) |
Dump TCPA log entries on console. More... | |
uint32_t | tpm_extend_pcr (int pcr, enum vb2_hash_algorithm digest_algo, const uint8_t *digest, size_t digest_len, const char *name) |
Ask vboot for a digest and extend a TPM PCR with it. More... | |
uint32_t | tpm_clear_and_reenable (void) |
Issue a TPM_Clear and re-enable/reactivate the TPM. More... | |
uint32_t | tpm_setup (int s3flag) |
Start the TPM and establish the root of trust. More... | |
uint32_t | tpm_measure_region (const struct region_device *rdev, uint8_t pcr, const char *rname) |
Measure a given region device and extend given PCR with the result. More... | |
void tcpa_log_add_table_entry | ( | const char * | name, |
const uint32_t | pcr, | ||
enum vb2_hash_algorithm | digest_algo, | ||
const uint8_t * | digest, | ||
const size_t | digest_len | ||
) |
Add table entry for cbmem TCPA log.
name | Name of the hashed data |
pcr | PCR used to extend hashed data |
diget_algo | sets the digest algorithm |
digest | sets the hash extended into the tpm |
digest_len | the length of the digest |
Definition at line 79 of file log.c.
References BIOS_WARNING, tcpa_entry::digest, tcpa_entry::digest_length, tcpa_entry::digest_type, tcpa_table::entries, tcpa_table::max_entries, memcpy(), name, tcpa_entry::name, tcpa_table::num_entries, tcpa_entry::pcr, printk, strncpy(), TCPA_DIGEST_MAX_LENGTH, tcpa_log_init(), TCPA_PCR_HASH_LEN, and TCPA_PCR_HASH_NAME.
Referenced by tpm_extend_pcr().
Dump TCPA log entries on console.
Definition at line 54 of file log.c.
References BIOS_INFO, tcpa_entry::digest, tcpa_entry::digest_length, tcpa_entry::digest_type, tcpa_table::entries, tcpa_entry::name, tcpa_table::num_entries, tcpa_entry::pcr, printk, and tcpa_log_init().
struct tcpa_table* tcpa_log_init | ( | void | ) |
Get the pointer to the single instance of global tcpa log data, and initialize it when necessary.
Definition at line 33 of file log.c.
References cbmem_possibly_online(), CONFIG, ENV_ROMSTAGE, and tcpa_cbmem_init().
Referenced by tcpa_log_add_table_entry(), tcpa_log_dump(), and tspi_measure_cache_to_pcr().
Clears the pre-RAM tcpa log data and initializes any content with default values.
Definition at line 116 of file log.c.
References BIOS_INFO, tcpa_table::max_entries, MAX_TCPA_LOG_ENTRIES, tcpa_table::num_entries, and printk.
Referenced by tspi_init_crtm().
Issue a TPM_Clear and re-enable/reactivate the TPM.
Definition at line 192 of file tspi.c.
References BIOS_ERR, BIOS_INFO, printk, tlcl_force_clear(), tlcl_set_deactivated(), tlcl_set_enable(), and TPM_SUCCESS.
Referenced by _factory_initialize_tpm(), safe_define_space(), safe_write(), and vb2ex_tpm_clear_owner().
uint32_t tpm_extend_pcr | ( | int | pcr, |
enum vb2_hash_algorithm | digest_algo, | ||
const uint8_t * | digest, | ||
size_t | digest_len, | ||
const char * | name | ||
) |
Ask vboot for a digest and extend a TPM PCR with it.
pcr | sets the pcr index |
diget_algo | sets the digest algorithm |
digest | sets the hash to extend into the tpm |
digest_len | the length of the digest |
name | sets additional info where the digest comes from |
Definition at line 220 of file tspi.c.
References BIOS_DEBUG, BIOS_ERR, CONFIG, name, NULL, printk, tcpa_log_add_table_entry(), tlcl_extend(), tlcl_lib_init(), TPM_E_IOERROR, TPM_SUCCESS, and tspi_tpm_is_setup().
Referenced by tspi_cbfs_measurement(), and vboot_extend_pcr().
uint32_t tpm_measure_region | ( | const struct region_device * | rdev, |
uint8_t | pcr, | ||
const char * | rname | ||
) |
Measure a given region device and extend given PCR with the result.
*rdev | Pointer to the region device to measure |
pcr | Index of the PCR which will be extended by this measure |
*rname | Name of the region that is measured |
Referenced by tspi_init_crtm().
uint32_t tpm_setup | ( | int | s3flag | ) |
Start the TPM and establish the root of trust.
s3flag | tells the tpm setup if we wake up from a s3 state on x86 |
Definition at line 135 of file tspi.c.
References BIOS_DEBUG, BIOS_ERR, BIOS_INFO, CONFIG, printk, tlcl_assert_physical_presence(), tlcl_lib_init(), tlcl_physical_presence_cmd_enable(), tlcl_startup(), TPM_E_INVALID_POSTINIT, tpm_is_setup, tpm_setup_epilogue(), tpm_setup_s3_helper(), TPM_SUCCESS, and tspi_measure_cache_to_pcr().
Referenced by bootblock_main_with_timestamp(), init_tpm_dev(), psp_verstage_s0i3_resume(), and vboot_setup_tpm().