From 01ad209f122b7c173477bd60c7997564f9c65961 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 28 Oct 2026 22:45:34 -0700 Subject: [PATCH] lib/crypto: mldsa: Add __must_check to mldsa_verify() Signature verification status always must be checked. Add __must_check, for consistency with e.g. the AES-GCM and ChaCha20Poly1305 functions. No effect on current callers, who always check the return value. Fixes: 64edccea594c ("lib/crypto: Add ML-DSA verification support") Cc: stable@vger.kernel.org Reviewed-by: Ard Biesheuvel Link: https://patch.msgid.link/20261029054534.68481-4-ebiggers@kernel.org Signed-off-by: Eric Biggers --- include/crypto/mldsa.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/crypto/mldsa.h b/include/crypto/mldsa.h index e0754879e745..b156f166a141 100644 --- a/include/crypto/mldsa.h +++ b/include/crypto/mldsa.h @@ -52,8 +52,9 @@ enum mldsa_alg { * * -EKEYREJECTED if the signature is invalid but otherwise well-formed * * -ENOMEM if out of memory so the validity of the signature is unknown */ -int mldsa_verify(enum mldsa_alg alg, const u8 *sig, size_t sig_len, - const u8 *msg, size_t msg_len, const u8 *pk, size_t pk_len); +int __must_check mldsa_verify(enum mldsa_alg alg, const u8 *sig, size_t sig_len, + const u8 *msg, size_t msg_len, const u8 *pk, + size_t pk_len); #if IS_ENABLED(CONFIG_CRYPTO_LIB_MLDSA_KUNIT_TEST) /* Internal function, exposed only for unit testing */