Skip to contentSkip to conversation

crypto: testmgr - make extra tests depend on cryptomgr

PATCH In review Eric Biggers 2 participants 2 messages May 20, 2019 – May 30, 2019 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: testmgr - make extra tests depend on cryptomgr

From: Eric Biggers <[email protected]>

The crypto self-tests are part of the "cryptomgr" module, which can technically be disabled (though it rarely is). If you do so, currently you can still enable CRYPTO_MANAGER_EXTRA_TESTS, which doesn't make sense since in that case testmgr.c isn't compiled at all. Fix it by making it CRYPTO_MANAGER_EXTRA_TESTS depend on CRYPTO_MANAGER2, like CRYPTO_MANAGER_DISABLE_TESTS already does.

Fixes 5b2706a4d459 ("crypto: testmgr - introduce CONFIG_CRYPTO_MANAGER_EXTRA_TESTS")
---
 crypto/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
crypto/Kconfig +4 -1
index 3d056e7da65f6..7009aff745cb7 100644
@@ -137,10 +137,11 @@ config CRYPTO_USER
 	  Userspace configuration for cryptographic instantiations such as
 	  cbc(aes).
 
+if CRYPTO_MANAGER2
+
 config CRYPTO_MANAGER_DISABLE_TESTS
 	bool "Disable run-time self tests"
 	default y
-	depends on CRYPTO_MANAGER2
 	help
 	  Disable run-time self tests that normally take place at
 	  algorithm registration.
@@ -155,6 +156,8 @@ config CRYPTO_MANAGER_EXTRA_TESTS
 	  This is intended for developer use only, as these tests take much
 	  longer to run than the normal self tests.
 
+endif	# if CRYPTO_MANAGER2
+
 config CRYPTO_GF128MUL
 	tristate "GF(2^128) multiplication functions"
 	help
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog
maintainer
#1 lore raw
Quoted 9 lines · Eric Biggers

From: Eric Biggers <[email protected]>

The crypto self-tests are part of the "cryptomgr" module, which can technically be disabled (though it rarely is). If you do so, currently you can still enable CRYPTO_MANAGER_EXTRA_TESTS, which doesn't make sense since in that case testmgr.c isn't compiled at all. Fix it by making it CRYPTO_MANAGER_EXTRA_TESTS depend on CRYPTO_MANAGER2, like CRYPTO_MANAGER_DISABLE_TESTS already does.

Quoted 5 lines
Fixes 5b2706a4d459 ("crypto: testmgr - introduce CONFIG_CRYPTO_MANAGER_EXTRA_TESTS")
---
 crypto/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt