coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
crtm.c File Reference
#include <console/console.h>
#include <fmap.h>
#include <cbfs.h>
#include "crtm.h"
#include <string.h>
Include dependency graph for crtm.c:

Go to the source code of this file.

Functions

static int tcpa_log_available (void)
 
static uint32_t tspi_init_crtm (void)
 
static bool is_runtime_data (const char *name)
 
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...
 
int tspi_measure_cache_to_pcr (void)
 Measure digests cached in TCPA log entries into PCRs. More...
 

Variables

static int tcpa_log_initialized
 

Function Documentation

◆ is_runtime_data()

static bool is_runtime_data ( const char *  name)
static

Definition at line 79 of file crtm.c.

References name, strchr(), strcmp(), strlen(), and strncmp().

Referenced by tspi_cbfs_measurement().

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

◆ tcpa_log_available()

static int tcpa_log_available ( void  )
inlinestatic

Definition at line 10 of file crtm.c.

References ENV_BOOTBLOCK, and tcpa_log_initialized.

Referenced by tspi_cbfs_measurement(), tspi_init_crtm(), and tspi_measure_cache_to_pcr().

Here is the caller graph for this function:

◆ 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_init_crtm()

static uint32_t tspi_init_crtm ( void  )
static

Definition at line 34 of file crtm.c.

References BIOS_ERR, BIOS_INFO, BIOS_WARNING, cbfs_ro_type_map(), CBFS_TYPE_BOOTBLOCK, cbfs_unmap(), fmap_locate_area_as_rdev(), NULL, printk, tcpa_log_available(), tcpa_log_initialized, tcpa_preram_log_clear(), TPM_CRTM_PCR, tpm_measure_region(), and type.

Referenced by tspi_cbfs_measurement().

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:

Variable Documentation

◆ tcpa_log_initialized

int tcpa_log_initialized
static

Definition at line 9 of file crtm.c.

Referenced by tcpa_log_available(), and tspi_init_crtm().