diff mbox series

crypto: fix unmet dependency on CRYPTO for CRYPTO_LIB_CHACHA_GENERIC

Message ID 20220117064248.102638-1-julianbraha@gmail.com
State New
Headers show
Series crypto: fix unmet dependency on CRYPTO for CRYPTO_LIB_CHACHA_GENERIC | expand

Commit Message

Julian Braha Jan. 17, 2022, 6:42 a.m. UTC
When CRYPTO_LIB_CHACHA is selected,
and CRYPTO is not selected,
Kbuild gives the following warning:

WARNING: unmet direct dependencies detected for CRYPTO_LIB_CHACHA_GENERIC
  Depends on [n]: CRYPTO [=n]
  Selected by [y]:
  - CRYPTO_LIB_CHACHA [=y] && (CRYPTO_ARCH_HAVE_LIB_CHACHA [=n] || !CRYPTO_ARCH_HAVE_LIB_CHACHA [=n]) && CRYPTO_ARCH_HAVE_LIB_CHACHA [=n]=n

This is because CRYPTO_LIB_CHACHA selects CRYPTO_LIB_CHACHA_GENERIC,
without selecting or depending on CRYPTO, despite
CRYPTO_LIB_CHACHA_GENERIC depending on CRYPTO.

This unmet dependency bug was detected by Kismet,
a static analysis tool for Kconfig. Please advise
if this is not the appropriate solution.

Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
 lib/crypto/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jason A. Donenfeld Jan. 18, 2022, 1:29 a.m. UTC | #1
A fix for this was submitted here already, I believe:

https://lore.kernel.org/linux-crypto/20220116165841.254196-1-Jason@zx2c4.com/
diff mbox series

Patch

diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig
index 179041b60294..4b4f5062ccc0 100644
--- a/lib/crypto/Kconfig
+++ b/lib/crypto/Kconfig
@@ -33,6 +33,7 @@  config CRYPTO_ARCH_HAVE_LIB_CHACHA
 
 config CRYPTO_LIB_CHACHA_GENERIC
 	tristate
+	depends on CRYPTO
 	select CRYPTO_ALGAPI
 	help
 	  This symbol can be depended upon by arch implementations of the
@@ -44,6 +45,7 @@  config CRYPTO_LIB_CHACHA_GENERIC
 config CRYPTO_LIB_CHACHA
 	tristate "ChaCha library interface"
 	depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA
+	depends on CRYPTO
 	select CRYPTO_LIB_CHACHA_GENERIC if CRYPTO_ARCH_HAVE_LIB_CHACHA=n
 	help
 	  Enable the ChaCha library interface. This interface may be fulfilled
@@ -114,6 +116,7 @@  config CRYPTO_LIB_CHACHA20POLY1305
 	tristate "ChaCha20-Poly1305 AEAD support (8-byte nonce library version)"
 	depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA
 	depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305
+	depends on CRYPTO
 	select CRYPTO_LIB_CHACHA
 	select CRYPTO_LIB_POLY1305