const char *data_device; /**< data_device (CRYPT_VERITY_CREATE_HASH) */
const char *hash_device; /**< hash_device (output only) */
const char *salt; /**< salt */
- uint64_t salt_size; /**< salt size (in bytes) */
+ uint32_t salt_size; /**< salt size (in bytes) */
+ uint32_t hash_type; /**< in-kernel hashing type */
uint32_t data_block_size; /**< data block size (in bytes) */
uint32_t hash_block_size; /**< hash block size (in bytes) */
uint64_t data_size; /**< data area size (in data blocks) */
uint64_t hash_area_offset; /**< hash/header offset (in bytes) */
- uint32_t hash_type; /**< in-kernel hashing type */
uint32_t flags; /**< CRYPT_VERITY* flags */
};
uint64_t data_block_size; /* data block in bytes */
uint64_t hash_block_size; /* hash block in bytes */
uint64_t data_blocks; /* number of data blocks */
- uint64_t salt_size; /* salt size */
+ uint16_t salt_size; /* salt size */
+ uint8_t _pad1[6];
uint8_t salt[256]; /* salt */
- uint8_t _pad[160];
+ uint8_t _pad2[160];
} __attribute__((packed));
#endif
return -EINVAL;
}
- params->salt_size = le64_to_cpu(sb.salt_size);
+ params->salt_size = le16_to_cpu(sb.salt_size);
if (params->salt_size > sizeof(sb.salt)) {
log_err(cd, _("VERITY header corrupted.\n"));
free(CONST_CAST(char*)params->hash_name);
sb.hash_type = cpu_to_le32(params->hash_type);
sb.data_block_size = cpu_to_le64(params->data_block_size);
sb.hash_block_size = cpu_to_le64(params->hash_block_size);
- sb.salt_size = cpu_to_le64(params->salt_size);
+ sb.salt_size = cpu_to_le16(params->salt_size);
sb.data_blocks = cpu_to_le64(params->data_size);
strncpy((char *)sb.algorithm, params->hash_name, sizeof(sb.algorithm));
memcpy(sb.salt, params->salt, params->salt_size);