uint64_t data_device_size;
int levels, i, r;
- log_dbg("Userspace hash %s %s, data device %s, data blocks %" PRIu64
+ log_dbg("Hash %s %s, data device %s, data blocks %" PRIu64
", hash_device %s, offset %" PRIu64 ".",
verify ? "verification" : "creation", hash_name,
data_device, data_blocks, hash_device, hash_position);
size_t root_hash_size)
{
return VERITY_create_or_verify_hash(cd, 1,
- verity_hdr->version,
+ verity_hdr->hash_type,
verity_hdr->hash_name,
hash_device,
data_device,
char *root_hash,
size_t root_hash_size)
{
- if (verity_hdr->salt_size > VERITY_MAX_SALT_SIZE)
+ int pgsize = crypt_getpagesize();
+
+ if (verity_hdr->salt_size > 256)
return -EINVAL;
+ if (verity_hdr->hash_block_size > pgsize ||
+ verity_hdr->data_block_size > pgsize)
+ log_err(cd, _("WARNING: Kernel cannot activate device if block "
+ "size exceeds page size (%u).\n"), pgsize);
+
return VERITY_create_or_verify_hash(cd, 0,
- verity_hdr->version,
+ verity_hdr->hash_type,
verity_hdr->hash_name,
hash_device,
data_device,