fsverity: explicitly check that there is no algorithm 0
authorEric Biggers <ebiggers@google.com>
Wed, 5 Jul 2023 21:17:19 +0000 (14:17 -0700)
committerEric Biggers <ebiggers@google.com>
Wed, 12 Jul 2023 05:49:18 +0000 (22:49 -0700)
commit5d37a1198068b099de47073411efc087d1b555ca
tree39624be68b704374ef11cfb3f53bc392a4143497
parent06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
fsverity: explicitly check that there is no algorithm 0

Since libfsverity and some other code would break if 0 is ever allocated
as an FS_VERITY_HASH_ALG_* value, make fsverity_check_hash_algs()
explicitly check that there is no algorithm 0.

Link: https://lore.kernel.org/r/20230705211719.37713-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/verity/hash_algs.c