| 1597 | } |
| 1598 | |
| 1599 | static 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 | |
| 1616 | static int cbfs_print(void) |
| 1617 | { |
nothing calls this directly
no test coverage detected