MCPcopy Create free account
hub / github.com/coreboot/coreboot / verify_walker

Function verify_walker

util/cbfstool/cbfstool.c:1599–1614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1597}
1598
1599static enum cb_err verify_walker(__always_unused cbfs_dev_t dev, size_t offset,
1600 const union cbfs_mdata *mdata, size_t already_read, void *arg)
1601{
1602 uint32_t type = be32toh(mdata->h.type);
1603 uint32_t data_offset = be32toh(mdata->h.offset);
1604 if (verification_exclude(type))
1605 return CB_CBFS_NOT_FOUND;
1606 assert(already_read == data_offset);
1607 const struct vb2_hash *hash = cbfs_file_hash(mdata);
1608 if (!hash)
1609 return CB_ERR;
1610 void *file_data = arg + offset + data_offset;
1611 if (vb2_hash_verify(false, file_data, be32toh(mdata->h.len), hash) != VB2_SUCCESS)
1612 return CB_CBFS_HASH_MISMATCH;
1613 return CB_CBFS_NOT_FOUND;
1614}
1615
1616static int cbfs_print(void)
1617{

Callers

nothing calls this directly

Calls 3

verification_excludeFunction · 0.85
cbfs_file_hashFunction · 0.50
vb2_hash_verifyFunction · 0.50

Tested by

no test coverage detected