mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
C doesn't guarantee at the language level that an enum actually has one
of the declared values.
For robustness, make mldsa_verify() handle invalid values of 'alg'.
No effect on current callers, who always pass a valid value for 'alg'.
(Except for the KUnit test case that this commit adds.)
Fixes: 64edccea59 ("lib/crypto: Add ML-DSA verification support")
Cc: [email protected]
Reviewed-by: Ard Biesheuvel <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Eric Biggers <[email protected]>