OpenCloudOS-Kernel/fs/verity
Eric Biggers a4bbf53d88 fsverity: simplify fsverity_get_digest()
Instead of looking up the algorithm by name in hash_algo_name[] to get
its hash_algo ID, just store the hash_algo ID in the fsverity_hash_alg
struct.  Verify at boot time that every fsverity_hash_alg has a valid
hash_algo ID with matching digest size.

Remove an unnecessary memset() of the whole digest array to 0 before the
digest is copied into it.

Finally, remove the pr_debug statement.  There is already a pr_debug for
the fsverity digest when the file is opened.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Link: https://lore.kernel.org/r/20221129045139.69803-1-ebiggers@kernel.org
2022-11-29 21:07:41 -08:00
..
Kconfig fs-verity: mention btrfs support 2022-07-15 23:42:30 -07:00
Makefile fs-verity: add FS_IOC_READ_VERITY_METADATA ioctl 2021-02-07 14:51:11 -08:00
enable.c Page cache changes for 5.19 2022-05-24 19:55:07 -07:00
fsverity_private.h fsverity: simplify fsverity_get_digest() 2022-11-29 21:07:41 -08:00
hash_algs.c fsverity: simplify fsverity_get_digest() 2022-11-29 21:07:41 -08:00
init.c fs-verity: remove filenames from file comments 2020-11-16 11:40:10 -08:00
measure.c fsverity: simplify fsverity_get_digest() 2022-11-29 21:07:41 -08:00
open.c fs-verity: remove unused parameter desc_size in fsverity_create_info() 2022-05-18 11:01:31 -07:00
read_metadata.c fs-verity: use kmap_local_page() instead of kmap() 2022-08-19 15:19:55 -07:00
signature.c fs-verity: don't pass whole descriptor to fsverity_verify_signature() 2021-02-07 14:51:09 -08:00
verify.c fsverity: stop using PG_error to track error status 2022-11-28 23:15:10 -08:00