49 "TSPI: Couldn't measure FMAP into CRTM!\n");
50 return VB2_ERROR_UNKNOWN;
62 return VB2_ERROR_UNKNOWN;
70 "TSPI: Couldn't measure bootblock into CRTM!\n");
71 return VB2_ERROR_UNKNOWN;
81 const char *allowlist = CONFIG_TPM_MEASURED_BOOT_RUNTIME_DATA;
82 size_t allowlist_len =
sizeof(CONFIG_TPM_MEASURED_BOOT_RUNTIME_DATA) - 1;
86 if (!allowlist_len || !name_len)
89 while ((end =
strchr(allowlist,
' '))) {
90 if (end - allowlist == name_len && !
strncmp(allowlist,
name, name_len))
106 "Initializing CRTM failed!\n");
136 return tpm_extend_pcr(pcr_index, hash->algo, hash->raw, vb2_digest_size(hash->algo),
143 enum vb2_hash_algorithm hash_alg;
152 return VB2_ERROR_UNKNOWN;
155 hash_alg = VB2_HASH_SHA1;
157 hash_alg = VB2_HASH_SHA256;
172 " of %s into PCR failed with error"
175 return VB2_ERROR_UNKNOWN;
void cbfs_unmap(void *mapping)
static void * cbfs_ro_type_map(const char *name, size_t *size_out, enum cbfs_type *type)
#define printk(level,...)
static uint32_t tspi_init_crtm(void)
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.
static bool is_runtime_data(const char *name)
static int tcpa_log_available(void)
int tspi_measure_cache_to_pcr(void)
Measure digests cached in TCPA log entries into PCRs.
static int tcpa_log_initialized
#define TPM_RUNTIME_DATA_PCR
int fmap_locate_area_as_rdev(const char *name, struct region_device *area)
void tcpa_preram_log_clear(void)
Clears the pre-RAM tcpa log data and initializes any content with default values.
struct tcpa_table * tcpa_log_init(void)
Get the pointer to the single instance of global tcpa log data, and initialize it when necessary.
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
int strcmp(const char *s1, const char *s2)
char * strchr(const char *s, int c)
int strncmp(const char *s1, const char *s2, int maxlen)
size_t strlen(const char *src)
uint8_t digest[TCPA_DIGEST_MAX_LENGTH]
char name[TCPA_PCR_HASH_NAME]
struct tcpa_entry entries[0]
uint32_t tlcl_extend(int pcr_num, const uint8_t *in_digest, uint8_t *out_digest)
Perform a TPM_Extend.
#define TCPA_PCR_HASH_NAME
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.
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.
int snprintf(char *buf, size_t size, const char *fmt,...)
Note: This file is only for POSIX compatibility, and is meant to be chain-included via string....