Lines Matching refs:desc

162 			       struct fsverity_descriptor *desc,  in compute_file_digest()  argument
165 __le32 sig_size = desc->sig_size; in compute_file_digest()
168 desc->sig_size = 0; in compute_file_digest()
169 err = fsverity_hash_buffer(hash_alg, desc, sizeof(*desc), file_digest); in compute_file_digest()
170 desc->sig_size = sig_size; in compute_file_digest()
181 struct fsverity_descriptor *desc) in fsverity_create_info() argument
192 desc->hash_algorithm, in fsverity_create_info()
193 desc->log_blocksize, in fsverity_create_info()
194 desc->salt, desc->salt_size); in fsverity_create_info()
202 memcpy(vi->root_hash, desc->root_hash, vi->tree_params.digest_size); in fsverity_create_info()
204 err = compute_file_digest(vi->tree_params.hash_alg, desc, in fsverity_create_info()
211 err = fsverity_verify_signature(vi, desc->signature, in fsverity_create_info()
212 le32_to_cpu(desc->sig_size)); in fsverity_create_info()
281 const struct fsverity_descriptor *desc, in validate_fsverity_descriptor() argument
284 if (desc_size < sizeof(*desc)) { in validate_fsverity_descriptor()
290 if (desc->version != 1) { in validate_fsverity_descriptor()
292 desc->version); in validate_fsverity_descriptor()
296 if (memchr_inv(desc->__reserved, 0, sizeof(desc->__reserved))) { in validate_fsverity_descriptor()
301 if (desc->salt_size > sizeof(desc->salt)) { in validate_fsverity_descriptor()
302 fsverity_err(inode, "Invalid salt_size: %u", desc->salt_size); in validate_fsverity_descriptor()
306 if (le64_to_cpu(desc->data_size) != inode->i_size) { in validate_fsverity_descriptor()
309 le64_to_cpu(desc->data_size), inode->i_size); in validate_fsverity_descriptor()
313 if (le32_to_cpu(desc->sig_size) > desc_size - sizeof(*desc)) { in validate_fsverity_descriptor()
329 struct fsverity_descriptor *desc; in fsverity_get_descriptor() local
342 desc = kmalloc(res, GFP_KERNEL); in fsverity_get_descriptor()
343 if (!desc) in fsverity_get_descriptor()
345 res = inode->i_sb->s_vop->get_verity_descriptor(inode, desc, res); in fsverity_get_descriptor()
348 kfree(desc); in fsverity_get_descriptor()
352 if (!validate_fsverity_descriptor(inode, desc, res)) { in fsverity_get_descriptor()
353 kfree(desc); in fsverity_get_descriptor()
357 *desc_ret = desc; in fsverity_get_descriptor()
365 struct fsverity_descriptor *desc; in ensure_verity_info() local
371 err = fsverity_get_descriptor(inode, &desc); in ensure_verity_info()
375 vi = fsverity_create_info(inode, desc); in ensure_verity_info()
384 kfree(desc); in ensure_verity_info()