Skip to contentSkip to conversation

crypto: fix CRYPTO_LIB_* dependencies on CRYPTO

PATCH In review Julian Braha 2 participants 2 messages Apr 5, 2021 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: fix CRYPTO_LIB_* dependencies on CRYPTO

Currently, when a config option selects a CRYPTO_LIB_* option while CRYPTO is disabled, Kbuild gives an unmet dependency. However, these config options do not actually need to depend on CRYPTO.

---
 crypto/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/Kconfig +1 -1
index 5809cc198fa7..fb7eca5cb8c6 100644
@@ -1870,9 +1870,9 @@ config CRYPTO_STATS
 config CRYPTO_HASH_INFO
 	bool
 
-source "lib/crypto/Kconfig"
 source "drivers/crypto/Kconfig"
 source "crypto/asymmetric_keys/Kconfig"
 source "certs/Kconfig"
 
 endif	# if CRYPTO
+source "lib/crypto/Kconfig"
Signature · 1 line
2.27.0
#1 lore raw
Quoted 17 lines · Julian Braha

Currently, when a config option selects a CRYPTO_LIB_* option while CRYPTO is disabled, Kbuild gives an unmet dependency. However, these config options do not actually need to depend on CRYPTO.

---
 crypto/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/Kconfig +0 -0
index 5809cc198fa7..fb7eca5cb8c6 100644

crypto/Kconfig config CRYPTO_STATS · line 1878

Quoted 10 lines
crypto/Kconfig +1 -1
@@ -1870,9 +1870,9 @@ config CRYPTO_STATS
 config CRYPTO_HASH_INFO
 	bool
 
-source "lib/crypto/Kconfig"
 source "drivers/crypto/Kconfig"
 source "crypto/asymmetric_keys/Kconfig"
 source "certs/Kconfig"
 
 endif	# if CRYPTO
+source "lib/crypto/Kconfig"

Actually some of the files in lib/crypto/ do depend on CRYPTO. For example, there are calls to crypto_xor_cpy() and crypto_memneq(), which call functions defined in crypto/algapi.c and crypto/memneq.c. These helper functions would need to be moved into lib/crypto/ for this to work.

- Eric