coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
crtm.h File Reference
#include <program_loading.h>
#include <security/tpm/tspi.h>
#include <types.h>
#include <vb2_sha.h>
Include dependency graph for crtm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TPM_CRTM_PCR   2
 
#define TPM_RUNTIME_DATA_PCR   3
 
#define TPM_MEASURE_ALGO   (CONFIG(TPM1) ? VB2_HASH_SHA1 : VB2_HASH_SHA256)
 

Functions

int tspi_measure_cache_to_pcr (void)
 Measure digests cached in TCPA log entries into PCRs. More...
 
uint32_t tspi_cbfs_measurement (const char *name, uint32_t type, const struct vb2_hash *hash)
 Extend a measurement hash taken for a CBFS file into the appropriate PCR. More...
 

Macro Definition Documentation

◆ TPM_CRTM_PCR

#define TPM_CRTM_PCR   2

Definition at line 12 of file crtm.h.

◆ TPM_MEASURE_ALGO

#define TPM_MEASURE_ALGO   (CONFIG(TPM1) ? VB2_HASH_SHA1 : VB2_HASH_SHA256)

Definition at line 19 of file crtm.h.

◆ TPM_RUNTIME_DATA_PCR

#define TPM_RUNTIME_DATA_PCR   3

Definition at line 17 of file crtm.h.

Function Documentation

◆ tspi_cbfs_measurement()

uint32_t tspi_cbfs_measurement ( const char *  name,
uint32_t  type,
const struct vb2_hash *  hash 
)

Extend a measurement hash taken for a CBFS file into the appropriate PCR.

Definition at line 98 of file crtm.c.

References BIOS_DEBUG, BIOS_WARNING, CBFS_TYPE_FIT, CBFS_TYPE_MRC, CBFS_TYPE_MRC_CACHE, CBFS_TYPE_SELF, CBFS_TYPE_STAGE, is_runtime_data(), name, printk, snprintf(), tcpa_log_available(), TCPA_PCR_HASH_NAME, TPM_CRTM_PCR, tpm_extend_pcr(), TPM_RUNTIME_DATA_PCR, tspi_init_crtm(), and type.

Referenced by cbfs_file_hash_mismatch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tspi_measure_cache_to_pcr()

int tspi_measure_cache_to_pcr ( void  )

Measure digests cached in TCPA log entries into PCRs.

Definition at line 140 of file crtm.c.

References BIOS_DEBUG, BIOS_ERR, BIOS_WARNING, CONFIG, tcpa_entry::digest, tcpa_table::entries, tcpa_entry::name, NULL, tcpa_table::num_entries, tcpa_entry::pcr, printk, tcpa_log_available(), tcpa_log_init(), tlcl_extend(), and TPM_SUCCESS.

Referenced by tpm_setup().

Here is the call graph for this function:
Here is the caller graph for this function: